|Bèr Kessels 2364fb30d1 spellcheck||10 years ago|
|README.md||10 years ago|
|cache_delayed.inc||10 years ago|
|cache_delayed.info||10 years ago|
|cache_delayed.install||11 years ago|
|cache_delayed.module||10 years ago|
|cache_delayed.override_all.diff||11 years ago|
A simple module that allows certain
cache_clear_all() calls to be delayed.
Requires core hacks. only for certain
For experienced Drupaleers only :) (it has severe side-effects, such as a much better working cache, or a broken site).
cache_clear_all(), replace with
cache_delayed_clear_all(). Calling the latter, puts a new to-be-cleared in the queue, which will be actually cleared on the next cron run.
Every time a cache_clear_all is invoked, instead of clearing the cache, it will add an entry to a worker queue. When calling a (secured) URL, we walk trough the queue, select those entries “old enough” and wipe them from your cache (and remove them from the queue).
For a certain site, we saw over 1000 queries to build pages. One quick-fix was to use the cache better. Drupals caching system however, is
brokennot very smart. And will flush on every comment posted, node created, poll-voted and so on. We wanted to avoid these wipes, by enforcing the cache to remain un-flushed for a little longer. Even if Drupal is stubborn and wipes it anyway.
You have two options.
Cherry-picking: Allow URL-parameters to wipe cache with a CID, in one table or with a wildcard only.
Few. We opt for speed, not flexibility.
We insert, delete and update with delayed and low_priority. Thus only works on databases that support that. And the resulting status can most often not be used at all. After all: mysql may wait with inserting a broken or duplicate record, but never report this brokenness or duplicateness back to our code. Keep an eye on the logs. Use the Logs Luke. Use the Logs.