Rails cache store class and time-based expiry support with :expires_in option
Cache Store Class
Rails 2.x has an abstract cache store class, which is great to use for caching queries in the controller, but there are a few big gotchas that you'll need to figure out. The fine print of the docs say little with a lot of links. The basics of it are that you need to worry about your cache store implementation. The docs recommends MemCacheStore. I'm not sure what else you could use out of the box.
MemCacheStore uses memcached as cache storage, and is required to use :expires_in
:expires_in
So :expires_in won't work unless you specify in your settings that you're using the MemCacheStore implementation (or something similar) because MemCacheStore supports the :expires_in option with the write commands. Otherwise your cache will not expire over time. It's probably a better idea to use memcached and MemCacheStore on production as it's probably the best solution currently, than to write something to the database that saves off cache times and such.
If anyone has other suggestions to better solutiosn other than MemCacheStore, please post! This is the only solution I've found looking through the docs.
