MediaWiki master
MediaWiki\Cache\HTMLCacheUpdater Class Reference

Class to invalidate the CDN and HTMLFileCache entries associated with URLs/titles. More...

Public Member Functions

 __construct (HookContainer $hookContainer, TitleFactory $titleFactory, $reboundDelay, $useFileCache, $cdnMaxAge)
 
 getUrls (PageReference $page, int $flags=0)
 Get a list of URLs to purge from the CDN cache when this page changes.
 
 purgeTitleUrls ( $pages, $flags=self::PURGE_PRESEND, array $unless=[])
 Purge the CDN/HTMLFileCache for a title or the titles yielded by an iterator.
 
 purgeUrls ( $urls, $flags=self::PURGE_PRESEND, array $unless=[])
 Purge the CDN for a URL or list of URLs.
 

Detailed Description

Class to invalidate the CDN and HTMLFileCache entries associated with URLs/titles.

Since
1.35

Definition at line 39 of file HTMLCacheUpdater.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Cache\HTMLCacheUpdater::__construct ( HookContainer $hookContainer,
TitleFactory $titleFactory,
$reboundDelay,
$useFileCache,
$cdnMaxAge )
Parameters
HookContainer$hookContainer
TitleFactory$titleFactory
int$reboundDelay$wgCdnReboundPurgeDelay
bool$useFileCache$wgUseFileCache
int$cdnMaxAge$wgCdnMaxAge
Access: internal
For use with MediaWikiServices->getHtmlCacheUpdater()

Definition at line 104 of file HTMLCacheUpdater.php.

Member Function Documentation

◆ getUrls()

MediaWiki\Cache\HTMLCacheUpdater::getUrls ( PageReference $page,
int $flags = 0 )

Get a list of URLs to purge from the CDN cache when this page changes.

Parameters
PageReference$page
int$flagsBit field of PURGE_URLS_* class constants (optional).
Returns
string[] URLs

Definition at line 211 of file HTMLCacheUpdater.php.

Referenced by MediaWiki\Cache\HTMLCacheUpdater\purgeTitleUrls().

◆ purgeTitleUrls()

MediaWiki\Cache\HTMLCacheUpdater::purgeTitleUrls ( $pages,
$flags = self::PURGE_PRESEND,
array $unless = [] )

Purge the CDN/HTMLFileCache for a title or the titles yielded by an iterator.

All cacheable canonical URLs associated with the titles will be purged from CDN. All cacheable actions associated with the titles will be purged from HTMLFileCache.

Parameters
Traversable | PageReference[] | PageReference$pagesPageReference or iterator yielding PageReference instances
int$flagsBit field of class PURGE_* constants [Default: HTMLCacheUpdater::PURGE_PRESEND]
mixed[]$unlessOptional map of (HTMLCacheUpdater::UNLESS_* constant => value)

Definition at line 167 of file HTMLCacheUpdater.php.

References MediaWiki\Cache\HTMLCacheUpdater\getUrls(), MediaWiki\Deferred\HtmlFileCacheUpdate\newFromPages(), and MediaWiki\Cache\HTMLCacheUpdater\purgeUrls().

◆ purgeUrls()

MediaWiki\Cache\HTMLCacheUpdater::purgeUrls ( $urls,
$flags = self::PURGE_PRESEND,
array $unless = [] )

Purge the CDN for a URL or list of URLs.

Parameters
string[] | string$urlsURL or list of URLs
int$flagsBit field of class PURGE_* constants [Default: HTMLCacheUpdater::PURGE_PRESEND]
mixed[]$unlessOptional map of (HTMLCacheUpdater::UNLESS_* constant => value)

Definition at line 135 of file HTMLCacheUpdater.php.

Referenced by MediaWiki\Cache\HTMLCacheUpdater\purgeTitleUrls().


The documentation for this class was generated from the following file: