Apologies if this is filed in the wrong place, but I have been unable to find documentation anywhere else.

I am confused about the behavior of the page cache in D6, which seems different from D5. I think that the inclusion of cache_clear_all(NULL, $table); in the system_cron() function significantly alters the way page cache works.

I am testing with minimum cache lifetime set to "none," though I believe other configurations would be affected as well (in slightly different ways).

In D5, which lacked the system_cron() function, expirable entries in page cache would only be deleted after specific events occurred. For example, creating or editing a node would cause expirable entries to be deleted. (Presumably because these actions were likely to cause the entries in page cache to become stale.) Visiting cron.php would not delete all expirable entries unless such an event had not taken place.

In D6, all expirable entries are deleted every single time cron.php is hit. This is true even if no changes have been made to the site (no nodes created or edited, etc).

Is the above description correct? If so, should/could this change in behavior be documented somewhere?

In my case (and perhaps others), it is desirable to have the entire page cache persist until the occurrence of an event that changes the site's data (creation / edit / deletion of a node, etc). For my purposes, hitting cron.php should not automatically wipe the page cache of all expirable entries. Is it possible to accomplish this in D6?

Thank you for your help!

Comments

dave reid’s picture

Status: Active » Fixed

If you change a node's path or title, it could be displayed or linked on every single page if you have a block. It would be much more complex for Drupal to figure out which pages can be succesfully cleared from the cache when things are changed rather than clearing the page cache. This is why we have the cache lifetime feature.

Status: Fixed » Closed (fixed)
Issue tags: -cron, -cache, -page cache

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

quotesbro’s picture

Version: 6.x-dev » 7.x-dev
Status: Closed (fixed) » Active

Description of system_cron() doesn't say that this function flushes caches. Should it be documented?

Status: Active » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.