Plugins - Timed File Store

StarAdd to favorites

Want 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.

Dominic Mitchell

http://happygiraffe.net/blog/archives/2006/05/08/timedfilestore-plugin-0-1

http://happygiraffe.net/svn/public/timed_file_store/trunk/

Rails' (MIT)

  • Currently 0.0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Controllers

Tags

Comments

Add a comment

Search Plugins

Query syntax

Plugins by Category

Sponsors

Rails Kits: Get Code. Get Moving.

Have a comment?