Fix FileStore cleanup method #816

lighthouse-import opened this Issue May 16, 2011 · 2 comments


None yet
1 participant

Imported from Lighthouse. Original ticket at:
Created by Brian Durand - 2011-01-18 18:10:11 UTC

The cleanup method on ActiveSupport::Cache::FileStore on the 3.0 branch is defined but doesn't actually work. I have fixed the implementation so it can be used to clean up old cache entries either by expiration time or by how recently they've been used and added tests.

This method is needed to keep the cache from growing without bound until if fills up the disk.

The syntax is:

Rails.cache.cleanup(:expired_only => true)


Rails.cache.cleanup(:not_accessed_in => 2.days)

Imported from Lighthouse.
Comment by Brian Durand - 2011-02-21 18:07:48 UTC

New patch file that include documentation update to Rails guide for caching.

Attachments saved to Gist:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment