views:

28

answers:

1

Hi guys,

I need a timebased caching of certain pages. Cache for certain page should be cleared each 15 minutes. Is that possible?

In http://edgeguides.rubyonrails.org/caching_with_rails.html manual I see that there is only manual cache clear methods, such as expire_page or expire_action.

Regards, Alexey

+2  A: 

It's possible out-of-the-box if you're using memcached for caching by specifying :expires_in. And here is a Rails ticket, which enables caching also with the default file store:

Kitto
Rails caching with memcached is the way to go for sure. The TTL parameter on each cache gives you very nice control over how long to keep the page content around and layering these into the layout is easy.
tadman