[development] Refresh rather than re-create D6 cache

Pierre Rineau pierre.rineau at makina-corpus.com
Mon Oct 18 15:14:26 UTC 2010


Le lundi 18 octobre 2010 à 08:04 -0700, Earl Miles a écrit :
> On 10/18/2010 3:22 AM, Tomáš Fülöpp (vacilando.org) wrote:
> > Hi,
> > 
> > In D6, after all caches are cleared, or after a lot of them expire and
> > get emptied by cron, the server load spikes seriously because all such
> > caches need to be re-populated.
> > 
> > Since this happens more and more on sites I work on, I have been
> > thinking about using another approach in my modules, in the sense that
> > caches would be /refreshed/ rather than cleared and re-populated. Each
> > cache refresh would run depending on e.g. a simple variable storing last
> > time stamp of any other cache refresh.
> > 
> > This would assure that a) all cached values would be available at all
> > times, b) caches would never be re-calculated all at the (near) same time.
> > 
> > I am about to write logic for this, but wanted to first check with
> > others in the list -- perhaps some of you know or can point to an
> > elegant solution that already exists.
> 
> This is the Pressflow caching model. When David Strauss first got into
> Drupal, he did a lot of work with this kind of thing, where caching
> wasn't done when requested, but on cron.

Drupal caching model is not wrong, but a lot of modules developers did
not understood how to use the hook_flush_caches() and implement massive
cache clear or data rebuild within this function, which is absolutely
wrong because core will run this hook at each cron run, thus making
those modules caches virtually useless.

It's not free critiscism, there was a time where I myself did the error
(I'm currently fixing a lot of code right now for site performances).
I'm currently reporting those issues with some D6 contrib modules .

Pierre.




More information about the development mailing list