Cache Trasher plugin
Plugin details
Documentation
Install the plugin:
ruby script/plugin install git://github.com/factore/cache_trasher.git
Example
=======
cache_trasher should be used in place of expire_page in your cache sweepers.
class PageSweeper < ActionController::Caching::Sweeper observe Page def after_save(page) # deletes public/pages and public/pages.html (if it exists) trash_cache(:controller => "pages") # deletes public/pages/view and public/pages/view.html (if it exists) trash_cache(:controller => "pages", :action => "view") # deletes public/pages/index.html trash_cache("index") # deletes your entire cache provided config.action_controller.page_cache_directory is not your public directory trashes_cache() end end
Note that trash_cache will never delete your entire public directory or everything in your public directory. However, it will delete pretty much anything else you tell it to regardless of whether or not it's actually a cached file, so be careful!
Further Documentation
There is currently no advanced documentation for this plugin.
New documentationEdit plugin | (0 older versions) | Last edited by: hardway, about 1 year ago


