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.

Support for options[:expires_in] for ActiveSupport::Cache::FileStore

#1693

While this options is supported for the MemCache Store, this support is missing in FileStore. Fortunately it's quite simple to implement. I also modified the documentation where relevant. Please see the attached patch.

Reported by Roman Shterenzon · January 4th, 2009 @ 06:09 PM

State: resolved
Milestone: 2.x
Assigned to: Pratik Pratik
Importance: none

Activity

  1. Roman Shterenzon
  2. Roman Shterenzon
    Roman Shterenzon
    • Tag changed from 2.2-stable, cache, patch to 2.2-stable, active_support, cache, patch
    • Assigned user set to josh

    Please review and tell me if there are any problems with this patch. Thanks!

    January 27th, 2009 @ 06:47 PM

  3. josh
    josh
    • Assigned user cleared.

    Curious what the performance effects are.

    January 29th, 2009 @ 03:19 AM

  4. Roman Shterenzon
    Roman Shterenzon

    According to my benchmark on my VMWare Linux it added 7 microseconds to every read from cache. IMHO it's tolerable.

    January 29th, 2009 @ 09:46 AM

  5. Roman Shterenzon
    Roman Shterenzon
    • Assigned user set to josh

    Please note, that my changed code (due to avoidance of rescue clause using the File.exist?) is about order of magnitude faster (~8) for non-existent files than the current version. Would you be so kind to look at this again? Thanks!

    February 2nd, 2009 @ 06:24 PM

  6. josh
    josh
    • Assigned user changed from josh to Pratik

    Pratik, thoughts?

    February 5th, 2009 @ 09:17 PM

  7. Pratik
    Pratik
    • Title changed from [PATCH] Support for options[:expires_in] for ActiveSupport::Cache::FileStore to Support for options[:expires_in] for ActiveSupport::Cache::FileStore

    February 16th, 2009 @ 07:23 PM

  8. Pratik
    Pratik
    • State changed from new to resolved

    Resolved in b5775c2b3efb3ae5ef9074d26f6fc3e302a4f6f0

    June 21st, 2009 @ 05:41 PM

  9. Repository
  10. Repository
  11. Evgeniy Dolzhenko
    Evgeniy Dolzhenko

    I believe that FileStore#exist? should be consistent with FileStore#read in presence of :expires_in option, i.e. exist? shouldn't return true if cache is already expired and read is going to return nil.

    Attached the patches for master and 2-3-stable.

    March 1st, 2010 @ 10:34 PM