# Time based fragement caching

**URL:** <https://www.ruby-forum.com/t/time-based-fragement-caching/138782>\
**Category:** Rails\
**Created:** [May 27, 2008, 5:50pm UTC](https://www.ruby-forum.com/t/time-based-fragement-caching/138782 "2008-05-27T17:50:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![aditya](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/df705f/32.png) [@aditya](https://www.ruby-forum.com/u/aditya)\
**Post date:** [May 27, 2008, 5:50pm UTC](https://www.ruby-forum.com/t/time-based-fragement-caching/138782/1 "2008-05-27T17:50:59Z")

</div>

Hi Guys,

I googled and found that time based fragment caching isnt something  
out of the box. No worries, I’m sure someone wrote a plugin for it.  
Any pointers? Whats the preferred pattern / technique for implementing  
time based frag cache expiry. I have a widget box that fetches pics  
from flickr, i dont want it to fetch more than once in 10 mins or so.  
Similarily I want to cache the featured profile fragment for at least  
a day.

Another, newbish question, Now that memory store is the default on  
cache store in Rails, this means that the cache is duplicated multiple  
times in each mongrel rails right? So, if i pick up a random record  
from the database and cache it, it is possible each one of my 6  
mongrels would cache potentially upto 6 different records, right?

How would class attributes be handled when we have multiple mongrels  
trying to update the same class attribute?

Cheers,  
Aditya
