Manual:Hooks/GetCacheVaryCookies
GetCacheVaryCookies | |
---|---|
Available from version 1.13.0 Get cookies that should vary cache options | |
Define function: | public static function onGetCacheVaryCookies( $out, &$cookies ) { ... }
|
Attach hook: | In extension.json:
{
"Hooks": {
"GetCacheVaryCookies": "MediaWiki\\Extension\\MyExtension\\Hooks::onGetCacheVaryCookies"
}
}
|
Called from: | File(s): OutputPage.php |
Interface: | GetCacheVaryCookiesHook.php |
For more information about attaching hooks, see Manual:Hooks .
For examples of extensions using this hook, see Category:GetCacheVaryCookies extensions.
Details
edit- $out: OutputPage object
- &$cookies: array of cookies name, add a value to it if you want to add a cookie that have to vary cache options