Hi,

Please consider adding cache cleaning options with cron runs such that admins can configuring clearing of cache after 24-48-36 hours.

Thanks

Rugman

Comments

willvincent’s picture

This seems like it might be better suited to contrib. But I think the idea has merit

willvincent’s picture

Actually.. isn't cache_clear_all() called on cron run already?

Rugman’s picture

Thanks for reply(s),

No, I don't experience cache clearance on automatic/manual cron runs (As far as my little knowledge is concerned) :-)

Atleast the cache tables are not empty as it happens when manually clearing caches.

Regards,

Rugman

willvincent’s picture

This is what's in system_cron()

  $core = array('cache', 'cache_path', 'cache_filter', 'cache_page', 'cache_form', 'cache_menu');
  $cache_tables = array_merge(module_invoke_all('flush_caches'), $core);
  foreach ($cache_tables as $table) {
    cache_clear_all(NULL, $table);
  }

Since it's passing in NULL for the cid though, this would only clear entries that have been or can be expired.

It seems to me best suited to contrib as I don't believe it's something that would be used widely enough to warrant inclusion in core. On the other hand, if it is something that should be included in core, rolling a contrib module of this sort into core wouldn't be a huge issue. The other bonus to doing this as contrib is that it would benefit you now, rather than having to wait for D8 to come out, and a 'maybe it gets backported to D7'.

So, I'm going to look into doing at this as a contrib project. That will give me something to work on in my hotel room tonight, and potentially on my flight back home tomorrow (if I don't finish it tonight.)

willvincent’s picture

Here's a sandbox project to do this in D7.
http://drupal.org/sandbox/tcindie/1733538

Rugman’s picture

WOW !!!

Wish I could create project like you did in a jiffy :-)

Thanks, Look ahead for Dev release of this. Don't know how to use it from Git release :-(

Regards,

Rugman

willvincent’s picture

Status: Active » Postponed

Hmm.. instructions for that are on the 'version control' tab for all projects and sandbox projects.. but ... http://drupal.org/project/cron_cache

Switching to postponed, as I think this is probably best addressed with contrib, but a core maintainer can make the final call.

willvincent’s picture

Priority: Major » Minor
Status: Postponed » Closed (works as designed)

This has been sitting out here for a while.

Closing it, as I wrote a simple contrib module to accomplish the desired goal. Re-open if needed.