Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Fix FileStore cleanup method

#6308

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)

or

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

Reported by Brian Durand · January 18th, 2011 @ 06:10 PM

State: new
Milestone: none
Assigned to: Xavier Noria Xavier Noria
Importance: Low

Activity

  1. Brian Durand
    Brian Durand
    • Tag changed from caching to caching, patch

    January 18th, 2011 @ 06:18 PM

  2. Xavier Noria
    Xavier Noria
    • Assigned user set to Xavier Noria
    • Importance changed from to Low

    January 25th, 2011 @ 09:52 AM

  3. Brian Durand
    Brian Durand

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

    February 21st, 2011 @ 06:07 PM