| 354 | | $app->send_http_header($ctx->stash('content_type')); |
|---|
| 355 | | $app->print($res); |
|---|
| | 356 | if ($app->{searchparam}{Template} eq 'feed') { |
|---|
| | 357 | my $last_update; |
|---|
| | 358 | for (@results) { |
|---|
| | 359 | my $created_on = ts2epoch($_->{blog}, $_->{entry}->created_on); |
|---|
| | 360 | $last_update = $created_on if $created_on > $last_update; |
|---|
| | 361 | } |
|---|
| | 362 | my $mod_since = $app->get_header('If-Modified-Since'); |
|---|
| | 363 | |
|---|
| | 364 | if ( !@results || ($last_update && $mod_since && ($last_update <= str2time($mod_since))) ) { |
|---|
| | 365 | $app->response_code(304); |
|---|
| | 366 | $app->response_message('Not Modified'); |
|---|
| | 367 | $app->send_http_header($ctx->stash('content_type')); |
|---|
| | 368 | } else { |
|---|
| | 369 | $app->set_header('Last-Modified', time2str($last_update)) if $last_update; |
|---|
| | 370 | $app->send_http_header($ctx->stash('content_type')); |
|---|
| | 371 | $app->print($res); |
|---|
| | 372 | } |
|---|
| | 373 | } else { |
|---|
| | 374 | $app->send_http_header($ctx->stash('content_type')); |
|---|
| | 375 | $app->print($res); |
|---|
| | 376 | } |
|---|