[development] Refresh rather than re-create D6 cache

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


Le lundi 18 octobre 2010 à 08:22 -0700, Earl Miles a écrit :
> On 10/18/2010 8:14 AM, Pierre Rineau wrote:
> > 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 .
> 
> I disagree. Drupal's behavior is actually bad here, because
> hook_flush_caches() is what we use when the 'clear cache' button is
> pressed. The cache clear that happens during cron runs is actually a
> misuse of the feature from its original intention, I think.

hook_flush_caches() function description is quite clear on api.d.o, it
specifies that this hook should just return cache table names.

During cron execution, it drops expired entries from these tables, which
is, quite logic. At 'cache clear' time, it fully wipes out data from
these tables, which make the hook signature still logic to me.

What's wrong here maybe the lack of a
hook_drupal_is_actually_flushing_the_cache_here_do_whatever_you_have_to().

> In any case, that wasn't really relevant to my point, which is that what
> you're asking about is the Pressflow model of caching, and you should
> look into it.

That's true, but it worth mention it.

Pierre.




More information about the development mailing list