Doesn't really jive with the microcaching mantra of the project, but...

It would be lovely to have an option for those using Drupal's core page cache (rather than an external cache) to be able to warm the caches of the oldest cached items rather than newest content.

In this way, minimum cache lifetime could be set to something like 2 days and the cache warmer could be set to hit URLs older than a day, and set to run once a day. This way, pages would always be cached and be fresh to within a day.

Comments

perusio’s picture

Hello,

You mean something like --update-before=<strtotime string> option so that all content updated before that date would be cached?

There's nothing that forces you to use an external cache. It will work with any cache. Be it internal or external. It's just that the main reason behind the project was an external cache refreshing.

iamEAP’s picture

The idea would be that instead of doing this like you do now...

$result = db_query("SELECT nid from {node} WHERE status = 1 AND changed >= '%d' ORDER BY changed DESC", $updated);

You could also do something like this...

$result = db_query("SELECT cid FROM {cache_page} WHERE created <= '%d' ORDER BY created", $olderthan);

Where $olderthan is a timestamp of a day ago (or however long or short a time period the user decides). This can be even handier because it's not just nodes, but all pages.

For the Drush command, the flags would be something like...

--cached-before=<strtotime string>

Given the external abilities you have, you may also have to set a flag for core vs. external caches.