You can use the base cache table (cache) or make your own by creating a new table with the same structure.<br><br>The cid value doesn't matter -- you make your own (any string). You'll want to make it something that you can easily recreate when it comes time to cache_get the stored data. So your cid could be something like "foo_" . $node->nid or whatever. I usually create a table if I'm going to be caching a lot of entries.
<br><br>I'm not sure if there is an existing handbook page detailing how/when the cache is cleared based on expire argument you pass in, but the api page for cache_set does have a reasonable overview (<a href="http://api.drupal.org/api/5/function/cache_set">
http://api.drupal.org/api/5/function/cache_set</a>)<br><br>William<br><br><div><span class="gmail_quote">On 5/18/07, <b class="gmail_sendername">Augustin (Beginner)</b> <<a href="mailto:drupal.beginner@wechange.org">drupal.beginner@wechange.org
</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>Hello,<br><br>I cannot find in the handbook a tutorial on the proper way to cache data.
<br><br>A function (<a href="http://drupal.org/node/144969">http://drupal.org/node/144969</a>) is calculating the values in a<br>large array, and I want to serialize the result to be able to cache it on the<br>database. This way, the array can be made static between requests, for better
<br>performance.<br><br>What would be the way to go about it?<br>Which {cache_*} table to use, what value to use for cid, etc?<br>How often or in what conditions are each of the cache tables emptied?<br><br>Is any of the above already documented somewhere?
<br><br><br>Thanks,<br><br>Augustin.<br><br><br>--<br><a href="http://www.wechange.org/">http://www.wechange.org/</a><br>Because we and the world need to change.<br><br><a href="http://www.reuniting.info/">http://www.reuniting.info/
</a><br>Intimate Relationships, peace and harmony in the couple.<br></blockquote></div><br>