diff options
| author | Seb Bacon <seb.bacon@gmail.com> | 2012-06-20 09:47:14 +0100 |
|---|---|---|
| committer | Seb Bacon <seb.bacon@gmail.com> | 2012-06-20 09:47:14 +0100 |
| commit | c100cb5aff5a958709aae77d03e6a4aea666a910 (patch) | |
| tree | 7099529c25b3fc929055a52784daabaaa88bc678 | |
| parent | 2b8321f0013111b85df229a6e9ade208e188bfef (diff) | |
Only extend the cache time on InfoRequest views for sites with Varnish purging set up
| -rw-r--r-- | app/controllers/request_controller.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb index 89d49ba57..2f5b4d643 100644 --- a/app/controllers/request_controller.rb +++ b/app/controllers/request_controller.rb @@ -46,7 +46,13 @@ class RequestController < ApplicationController end def show - long_cache + if !MySociety::Config.get('VARNISH_HOST').nil? + # If varnish is set up to accept PURGEs, then cache for a + # long time + long_cache + else + medium_cache + end @locale = self.locale_from_params() PublicBody.with_locale(@locale) do |
