<font size="2">Larry, thanks for the tips; I am looking into how search
indexing works and I definitely will use Views Content Cache (don't know
how could I miss it!)<br></font><font size="2"><br style="color: rgb(102, 102, 102);">
</font><br>
<br><br><div class="gmail_quote">On Mon, Oct 18, 2010 at 15:41, <a href="mailto:larry@garfieldtech.com">larry@garfieldtech.com</a> <span dir="ltr"><<a href="mailto:larry@garfieldtech.com">larry@garfieldtech.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">I... think I follow? It sounds like you want an approach like the search index uses; when you tell it to rebuild the search index it doesn't truncate the index but marks all records as "dirty", so they get reindexed over time by cron.<br>
<br>
You may also find this of use:<br>
<br>
<a href="http://drupal.org/project/views_content_cache" target="_blank">http://drupal.org/project/views_content_cache</a><br>
<br>
--Larry Garfield<div class="im"><br>
<br>
On 10/18/10 8:31 AM, Tomáš Fülöpp (<a href="http://vacilando.org" target="_blank">vacilando.org</a>) wrote:<br>
</div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im">
Yes, Larry, I did experiment with that approach as well. It allows<br>
caches to expire at different times, but a) you need to keep some sort<br>
of approximate overview about the various expiration delays you're<br>
setting (so that they don't have much chance happening at the same time)<br>
and b) whenever such cache happens to expire, it still gets deleted at<br>
cron and then will have to be re-calculated during the precious time of<br>
page request.<br>
<br>
Currently I am thinking about the following approach - crude pseudo code:<br>
<br>
// Make sure no other cache has been started over defined period<br>
* set buffer period between cache refreshes $cbuffer = 15 seconds<br>
* if ( (time()-$lastcacherun) > $cbuffer )<br>
<br>
// Check if the cache at hand has expired<br>
* Set some cache life time $clife<br>
* SELECT `created` FROM `cache` where `cid` = 'cachedobjectname'<br>
* if ( (time()-$created) > $clife )<br>
<br>
// Refresh the expired cache<br>
* $lastcacherun = time()<br>
* recreate cachedobjectname<br>
* DELETE FROM `cache` WHERE cid = 'cachedobjectname'<br>
* cache cachedobjectname using cache_set with CACHE_PERMANENT<br>
<br>
What do you think?<br>
<br>
<br>
<br>
<br>
<br>
<br>
On Mon, Oct 18, 2010 at 14:34, <a href="mailto:larry@garfieldtech.com" target="_blank">larry@garfieldtech.com</a><br></div>
<mailto:<a href="mailto:larry@garfieldtech.com" target="_blank">larry@garfieldtech.com</a>> <<a href="mailto:larry@garfieldtech.com" target="_blank">larry@garfieldtech.com</a><div class="im"><br>
<mailto:<a href="mailto:larry@garfieldtech.com" target="_blank">larry@garfieldtech.com</a>>> wrote:<br>
<br>
Just to make sure, have you tried using the minimum cache lifetime<br>
on the performance page? It essentially says that a cache record<br>
will always last at least that long, even if a clear is requested<br>
for it. That's your first step if you're finding some caches<br>
clearing too frequently (especially the expensive filter and page<br>
caches).<br>
<br>
--Larry Garfield<br>
<br>
<br>
On 10/18/10 5:22 AM, Tomáš Fülöpp (<a href="http://vacilando.org" target="_blank">vacilando.org</a><br></div><div class="im">
<<a href="http://vacilando.org" target="_blank">http://vacilando.org</a>>) wrote:<br>
<br>
Hi,<br>
<br>
In D6, after all caches are cleared, or after a lot of them<br>
expire and<br>
get emptied by cron, the server load spikes seriously because<br>
all such<br>
caches need to be re-populated.<br>
<br>
Since this happens more and more on sites I work on, I have been<br>
thinking about using another approach in my modules, in the<br>
sense that<br>
caches would be /refreshed/ rather than cleared and<br>
re-populated. Each<br>
cache refresh would run depending on e.g. a simple variable<br>
storing last<br>
time stamp of any other cache refresh.<br>
<br>
This would assure that a) all cached values would be available<br>
at all<br>
times, b) caches would never be re-calculated all at the (near)<br>
same time.<br>
<br>
I am about to write logic for this, but wanted to first check with<br>
others in the list -- perhaps some of you know or can point to an<br>
elegant solution that already exists.<br>
<br>
Thanks!<br>
<br>
vacilando<br>
<br>
<br>
<br>
</div></blockquote>
</blockquote></div><br>