Manual:Hooks/TitleSquidURLs

From mediawiki.org
TitleSquidURLs
Available from version 1.22.0 (Gerrit change 64290)
Allows adding to/modifying the list of URLs to purge when a title is purged
Define function:
public static function onTitleSquidURLs( Title $title, array &$urls ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"TitleSquidURLs": "MediaWiki\\Extension\\MyExtension\\Hooks::onTitleSquidURLs"
	}
}
Called from: File(s): Title.php
Interface: TitleSquidURLsHook.php

For more information about attaching hooks, see Manual:Hooks .
For examples of extensions using this hook, see Category:TitleSquidURLs extensions.


Details[edit]

This provides more fine-grained control over purging of pages cached by an HTTP accelerator such Varnish or Squid. Normally, when the cache is purged, the internal URL is purged ($title->getInternalURL()), as well as the action=history variant of that. This allows a hook listener to change (usually, add to), the list of affected URLs, if additional URLs depend on the content of a title.

See also[edit]