Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
It is frequent for the type of site I build (records label, clubs, bands) to have an event listing built with views that doesn't update because the cache is active and since new content and/or comments are inserted rarely the cache isn't flushed. Infact drupal doesn't rebuild the cache until content is created or modified and therefore a dynamic view that list (e.g. upcoming concerts) isn't updated. So it would be cool to have an option for a maximum cache lifetime.
Comments
Comment #1
kbahey CreditAttribution: kbahey commentedWe don't need this to be in core.
You can do this via a small module, like this:
Create a file called cache_reset.info and put in it the following:
Then create a file called cache_reset.module and put in it the following:
This will reset the cache every hour.
Comment #2
dodorama CreditAttribution: dodorama commentedThanks for the hint.
I was wondering if using cache_clear_all with drupal 5 is the same (drupal_flush_all_caches is not available).
Comment #3
sunFlushing caches when cron runs would be insane.
Comment #4
kbahey CreditAttribution: kbahey commentedIt is not insane.
If it is, then why do we have this code in system module in Drupal 6?
Comment #5
sunBecause it only flushes _expired_ cache entries?