orslumen/record-cache — pull request #30 by joshtabak (2013-03-13 03:09:15+00:00)
Title: Adds an optional TTL to limit cache time

We have external services that update cached models without going through rails (not a recommended design), and found that the best way to avoid serving cached results from record-cache was to add a TTL to these models, so the data would expire after a set time.

The TTL parameter is optional, and has some jitter built in to help prevent records from leaving cache at the same time. The syntax for using it is like so:

cache_records :store => :shared, :unique_index => :login, :ttl => 300