Plugins - Timed File Store
Add to favoritesWant your fragment cache to expire based on time and not your particular model? This is what you need.
To activate, place something like this at the bottom of config/environment.rb.
ActionController::Base.fragment_cache_store = TimedFileStore.new("#{RAILS_ROOT}/tmp/cache", :atime => 15.minutes)
NB: This has to come at the bottom, outside of the Rails::Initializer.run block. This is because the plugin isn’t loaded until fairly late in the configuration process.
You can specify either :atime to judge based upon the last time that fragment was read, or :mtime to judge based on the time the fragment was last written to.
If you have any questions, please contact dom (at) happygiraffe (dot) net.
http://happygiraffe.net/blog/archives/2006/05/08/timedfilestore-plugin-0-1
http://happygiraffe.net/svn/public/timed_file_store/trunk/
Rails' (MIT)
Controllers
