diff options
Diffstat (limited to 'perllib/FixMyStreet/App/Controller')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Photo.pm | 3 | ||||
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Reports.pm | 5 |
2 files changed, 4 insertions, 4 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Photo.pm b/perllib/FixMyStreet/App/Controller/Photo.pm index 3ca7f13a9..8711b19e9 100644 --- a/perllib/FixMyStreet/App/Controller/Photo.pm +++ b/perllib/FixMyStreet/App/Controller/Photo.pm @@ -94,8 +94,7 @@ sub index :LocalRegex('^(c/)?(\d+)(?:\.(full|tn|fp))?\.jpeg$') { sub output : Private { my ( $self, $c, $photo ) = @_; - my $dt = DateTime->now(); - $dt->set_year( $dt->year + 1 ); + my $dt = DateTime->now()->add( years => 1 ); $c->res->content_type( 'image/jpeg' ); $c->res->header( 'expires', DateTime::Format::HTTP->format_datetime( $dt ) ); diff --git a/perllib/FixMyStreet/App/Controller/Reports.pm b/perllib/FixMyStreet/App/Controller/Reports.pm index 5d70ae113..e7620f755 100644 --- a/perllib/FixMyStreet/App/Controller/Reports.pm +++ b/perllib/FixMyStreet/App/Controller/Reports.pm @@ -31,8 +31,6 @@ Show the summary page of all reports. sub index : Path : Args(0) { my ( $self, $c ) = @_; - $c->response->header('Cache-Control' => 'max-age=3600'); - # Fetch all areas of the types we're interested in my $areas_info; eval { @@ -73,6 +71,9 @@ sub index : Path : Args(0) { sprintf(_('The error was: %s'), $@); $c->stash->{template} = 'errors/generic.html'; } + + # Down here so that error pages aren't cached. + $c->response->header('Cache-Control' => 'max-age=3600'); } =head2 index |