[development] Proper way to cache data

Jeff Eaton jeff at viapositiva.net
Sat May 19 01:39:47 UTC 2007

I just spent some time answering this question for a client, so I had a 
quick write-up lying around. I polished it up into an article and 
published it on the Lullabot site -- 
http://www.lullabot.com/articles/a_beginners_guide_to_caching_data has 
an overview of the various bits and pieces I've picked up.

The early bits might be a bit unnecessary given that you already know 
the value of caching ;-) but a tutorial it is!


Augustin (Beginner) wrote:
> Hello,
> I cannot find in the handbook a tutorial on the proper way to cache data.
> A function (http://drupal.org/node/144969) is calculating the values in a 
> large array, and I want to serialize the result to be able to cache it on the 
> database. This way, the array can be made static between requests, for better 
> performance. 
> What would be the way to go about it?
> Which {cache_*} table to use, what value to use for cid, etc?
> How often or in what conditions are each of the cache tables emptied?
> Is any of the above already documented somewhere?
> Thanks,
> Augustin.

More information about the development mailing list