Last modified: 2011-08-23 18:43:49 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T32448, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 30448 - Extension authors should be able to set parser cache TTL
Extension authors should be able to set parser cache TTL
Status: RESOLVED WORKSFORME
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
unspecified
All All
: Unprioritized enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-08-18 18:24 UTC by Mark A. Hershberger
Modified: 2011-08-23 18:43 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Mark A. Hershberger 2011-08-18 18:24:46 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.
Comment 1 Asher Feldman 2011-08-18 18:54:26 UTC
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.
Comment 2 Mark A. Hershberger 2011-08-18 19:09:30 UTC
Note that it should be Bug #30428
Comment 3 Roan Kattouw 2011-08-18 21:28:44 UTC
(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.
Comment 4 Roan Kattouw 2011-08-18 21:31:42 UTC
So since the requested feature is already present, should we repurpose this bug to be about changing CategoryTree to set a TTL?
Comment 5 Brion Vibber 2011-08-23 18:43:49 UTC
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.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links