Tag Archives: caching

TimedFileStore Plugin 0.1

My first rails plugin: timed_file_store is now available. It lets you expire fragments based upon the time of the cached file. It’s fairly easy to use; just bung this into config/environments.rb: ActionController::Base.fragment_cache_store = TimedFileStore.new(“#{RAILS_ROOT}/tmp/cache”, :atime => 15.minutes) And now any fragments which haven’t been accessed in the last 15 minutes will be removed the next […]

Rails Fragment Cache Expiry

I’ve been looking at Rails’ fragment caching recently. I want to cache some stuff in my view that’s more or less independent of my model (eg: output from some slow command like top). That’s fine, and easily done. <% cache do %> <%=h `top` %> <% end %> The trouble is expiry (as it always […]