diff options
-rw-r--r-- | app/controllers/request_controller.rb | 2 | ||||
-rw-r--r-- | doc/CHANGES.md | 7 | ||||
-rw-r--r-- | lib/quiet_opener.rb | 6 |
3 files changed, 10 insertions, 5 deletions
diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb index aa770e151..89d49ba57 100644 --- a/app/controllers/request_controller.rb +++ b/app/controllers/request_controller.rb @@ -46,7 +46,7 @@ class RequestController < ApplicationController end def show - medium_cache + long_cache @locale = self.locale_from_params() PublicBody.with_locale(@locale) do diff --git a/doc/CHANGES.md b/doc/CHANGES.md index bdc811a21..0abbeec82 100644 --- a/doc/CHANGES.md +++ b/doc/CHANGES.md @@ -57,7 +57,12 @@ you leave `VARNISH_HOST` blank, it will have no effect. Finally, you should install the `purge-varnish` init script that's provided in `ugly` format at `config/purge-varnish-debian.ugly` to ensure the - purge queue is emptied regularly. + purge queue is emptied regularly. Once deployed, you should also + check your production log for lines starting `PURGE:` to ensure the + purges are successful (a failure will typically be due to a + misconfigured Varnish). If purges are unsuccessful, the conseqence + is that individual request pages that are served to anonymous users + will be up to 24 hours out of date. * Administrators are now assumed to log in using standard user accounts with superuser privileges (see 'Administrator Privileges' in diff --git a/lib/quiet_opener.rb b/lib/quiet_opener.rb index 2f78f76ad..f313b303c 100644 --- a/lib/quiet_opener.rb +++ b/lib/quiet_opener.rb @@ -24,12 +24,12 @@ def quietly_try_to_purge(host, url) } end rescue OpenURI::HTTPError, SocketError, Errno::ETIMEDOUT, Errno::ECONNREFUSED, Errno::EHOSTUNREACH - Rails.logger.warn("Unable to reach host #{host}") + Rails.logger.warn("PURGE: Unable to reach host #{host}") end if result == "200" - Rails.logger.info("Purged URL #{url} at #{host}: #{result}") + Rails.logger.info("PURGE: Purged URL #{url} at #{host}: #{result}") else - Rails.logger.warn("Unable to purge URL #{url} at #{host}: status #{result}") + Rails.logger.warn("PURGE: Unable to purge URL #{url} at #{host}: status #{result}") end return result end |