Page cache & event calendar
gushie - November 9, 2006 - 13:30
I have a website which doesn't change very often (weekly updates) and I have page cache enabled with a 5 minute minimum cache lifetime.
Is there a way to set a 'maximum cache lifetime' or automatically clear the cache at regular intervals?
The reason I ask is that I have an event calendar block on the page which colours in the current day of the month. The problem is there are times that a cached page from a couple of days ago is shown, so every anonymous user effectively gets sent back in time!
Thanks.

php code
Right now i'm testing this code to clear cache.
<?phpglobal $base_root;
$this_page = request_uri();
cache_clear_all($base_root . $this_page);
?>
www.ferjan.net
And does it work?
I had the same problem (Drupal 4.7.4) with cache enabled, (anonymous) users were complaining that the calendar was at least a week old.
Disabled the cache, and problem was gone.
Doesn't the cache refresh itself on the (max) time you set it?
Thanks,
Marc
it works
it works
www.drm-drustvo.si
www.ferjan.net
But where do you put that
But where do you put that code? If you put that into the content of a page that you don't want to be cached, it won't work, because that php will only execute when the page isn't cached.
If the page is cached, then drupal will just serve the end html, right? The php in the page won't execute if it's coming from cache.
That's the problem I have now.
Same here
I´ve got the same problem here. Do you know a workaround ?
Where does that code go ?
Possible workaround
I disabled the minimum cache lifetime and it seems to work. Try it out. Not a solution but at least works.
Disable the minimum cache lifetime?
As in, set it to none? I had it set to none and I was having this same problem. On the chance you meant setting it to something low (like 1-15 minutes), I've changed it to 15 minutes to see what happens.