I ran into a problem with the caching system: on a site with the calendar/date Views-CCK implementation where new content is only added once or twice a month, the page cache is not cleared often enough to keep a calendar teaser list up to date. To get around this, I have had to disable page caching entirely.

It would be terrific to get control of this via cron - we'd need an admin-controllable setting for it (i.e. "clear page cache once every X interval").

Thank you very much!

- HornCologne

Comments

dodorama’s picture

I'd like to see this feature too. In my experience with bands and record labels websites this is always a big problem cause cache can't be enabled.

gpk’s picture

Status: Active » Closed (won't fix)

If the events list is not upating then that is a calendar/date Views problem. They should invalidate the cache as necessary to keep the site content fresh.

BTW this happens automatically in D6 calendar/date Views from what I can make out.

A tiny contrib module could also do this.

Marking as won't fix.

adixon’s picture

A simple solution is to run a (unix, not drupal) cron that clears the specific page cache on the schedule you choose.

For example, the mysql statement:

DELETE FROM cache_page WHERE cid = 'http://example.com/'

would clear your front page cache. You could run it each hour so that your front page is getting updated then. Your cron would then look like:

1 * * * * mysql -u user -ppass dbname -e "DELETE FROM cache_page WHERE cid = 'http://example.com'"

It might be nicer to put that mysql into a shell script, but the above should work with perhaps a little adjustment to your specific server setup.

gpk’s picture

Status: Closed (won't fix) » Fixed

Actually cache_page (and the other caches) gets cleared *every* cron run since Drupal 6.2 - see #226728: Temporary cache table entries are not flushed and http://api.drupal.org/api/function/system_cron/6 and http://cvs.drupal.org/viewvc.py/drupal/drupal/modules/system/system.modu.... The fix finally made in to 7.x in October 2008, but is marked as needing further work.

On sites I run (which are not very busy) I would actually prefer it if cache_page *didn't* get cleared every cron run since serving pages from the cache reduces page generation time so much..!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.