Last modified: 2011-08-23 18:43:49 UTC
From Bug #30427, comment #6: > It seems as though completely disabling > the cache is *very* rarely the right answer in production, and that setting a > very short time-to-live on the parser cache (e.g. 5 minutes) will be good > enough in 99% of cases. Is setting parser cache TTL something that is as easy > for extension authors to do as disabling the cache entirely? This may already be possible, but I'm opening a new bug with the question since the original bug is solved.
It is. Extensions with a Parser object can call: $parser->getOutput()->updateCacheExpiry( $expire ); Just as CategoryTree calls $parser->disableCache(); 5 minutes seems low but the current default (a year? which with the db store may actually be doable) is way too high. An hour might be reasonable. The more pages with low parser cache ttl's, the more write load on there will be on the pcache db, and the slower everything will be.
Note that it should be Bug #30428
(In reply to comment #1) > It is. Extensions with a Parser object can call: > > $parser->getOutput()->updateCacheExpiry( $expire ); > > Just as CategoryTree calls $parser->disableCache(); > > 5 minutes seems low but the current default (a year? which with the db store > may actually be doable) is way too high. An hour might be reasonable. Core behavior is to set the TTL to an hour when time-bound magic words like {{CURRENTDAY}} are involved. See includes/MagicWord.php line 118 and below.
So since the requested feature is already present, should we repurpose this bug to be about changing CategoryTree to set a TTL?
Well I'm just resolving this WORKSFORME. If someone cares specifically about CategoryTree or any other specific extension, might want to open a fresh bug.