aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2019-02-04 14:18:40 +0000
committerMatthew Somerville <matthew-github@dracos.co.uk>2019-02-04 14:21:02 +0000
commit265fe86bc5028d48442c994decc2fca22de473be (patch)
tree75c527577b36291a82398e86178811631d2877cc /perllib/FixMyStreet/App/Controller
parent47befd5dcbb3fefc6c4d99b65ee125275c3d8509 (diff)
Make front page cache time configurable.
Add a configuration variable to use for the front page stats/ recent list, plus the max-age of `/reports`.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller')
-rw-r--r--perllib/FixMyStreet/App/Controller/Reports.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Reports.pm b/perllib/FixMyStreet/App/Controller/Reports.pm
index 42f5ea288..975b2fdd5 100644
--- a/perllib/FixMyStreet/App/Controller/Reports.pm
+++ b/perllib/FixMyStreet/App/Controller/Reports.pm
@@ -74,7 +74,8 @@ sub index : Path : Args(0) {
}
# Down here so that error pages aren't cached.
- $c->response->header('Cache-Control' => 'max-age=3600');
+ my $max_age = FixMyStreet->config('CACHE_TIMEOUT') // 3600;
+ $c->response->header('Cache-Control' => 'max-age=' . $max_age);
}
=head2 display_body_stats