| RejectParserCacheValue | |
|---|---|
| Available fromversion 1.26.0 (Gerrit change I660679a48c) Return false to reject an otherwise usable cached value from the Parser cache. | |
| Define function: | publicstaticfunctiononRejectParserCacheValue($parserOutput,$wikiPage,$parserOptions){...} |
| Attach hook: | Inextension.json:{"Hooks":{"RejectParserCacheValue":"MediaWiki\\Extension\\MyExtension\\Hooks::onRejectParserCacheValue"}} |
| Called from: | File(s):parser/ParserCache.php Function(s):get |
| Interface: | RejectParserCacheValueHook.php |
For more information about attaching hooks, seeManual:Hooks.
For examples of extensions using this hook, seeCategory:RejectParserCacheValue extensions.
| Misuse of this hook can effectively disable the parser cache, with serious consequences for high-traffic installations. Use with extreme care. |
This hook allows extensions to reject an otherwise-successful parser cache lookup. The intent is to allow extensions to manage the eviction of archaic HTML output from the cache.
Returntrue or no return value to continue, orfalse to reject an otherwise usable cached value from the Parser cache.
Seepatch 587264 in gerrit for an example of the use of this hook in WMF production to mitigate an issue which caused parser cache corruption. Searching forRejectParserCache in themediawiki-config repository usinggit log -SRejectParserCache or equivalent will list other examples of use in WMF production. SeeT296425 for equivalent code to manage stored content stored inRESTBase.
$parserOutput:ParserOutput object$wikiPage:WikiPage object$parserOptions:ParserOptions object