diff options
author | Francis Irving <francis@mysociety.org> | 2010-05-19 15:08:53 +0100 |
---|---|---|
committer | Francis Irving <francis@mysociety.org> | 2010-05-19 15:08:53 +0100 |
commit | ecf920001a80d4eaa4fa34c7c465fe7e00964f32 (patch) | |
tree | 14e2b137684af6806b4128aa797149eba07742c8 /app/controllers/admin_controller.rb | |
parent | 76abcd06b6531e15846d126431fc0edbc705f760 (diff) |
Do the cacheing ourselves.
Diffstat (limited to 'app/controllers/admin_controller.rb')
-rw-r--r-- | app/controllers/admin_controller.rb | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index 48e223cea..ca5538e03 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -19,19 +19,9 @@ class AdminController < ApplicationController # Expire cached attachment files for a request def expire_for_request(info_request) - # Clear out cached entries - use low level disk removal, even though we - # are clearing results from caches_action, for several reasons: - # * We can't use expire_action here, as it doesn't seem to be - # compatible with the :only_path we used in the caches_action - # call. - # * Removing everything is simpler than having to get all the - # parameters right for the path, and calling for HTML version vs. raw - # attachment version. - # * We cope properly with filenames changed by censor rules, which - # change the URL. - # * We could use expire_fragment with a Regexp, but it walks the whole - # cache which is insanely slow - cache_subpath = File.join(self.cache_store.cache_path, foi_fragment_cache_all_for_request(info_request)) + # Clear out cached entries, by removing files from disk (the built in + # Rails fragment cache made doing this and other things too hard) + cache_subpath = foi_fragment_cache_all_for_request(info_request) FileUtils.rm_rf(cache_subpath) # Remove the database caches of body / attachment text (the attachment text |