MediaWiki master
MediaWiki\Deferred\CdnCacheUpdate Class Reference

Handles purging the appropriate CDN objects given a list of URLs or Title instances. More...

Inherits MediaWiki\Deferred\DeferrableUpdate, and MediaWiki\Deferred\MergeableUpdate.

Collaboration diagram for MediaWiki\Deferred\CdnCacheUpdate:

Public Member Functions

 __construct (array $targets, array $options=[])
 
 doUpdate ()
 Perform the actual work.
 
 getUrls ()
 
 merge (MergeableUpdate $update)
 Merge this enqueued update with a new MergeableUpdate of the same qualified class name.
 

Static Public Member Functions

static purge (array $urls)
 Purges a list of CDN nodes defined in $wgCdnServers.
 

Detailed Description

Handles purging the appropriate CDN objects given a list of URLs or Title instances.

Definition at line 37 of file CdnCacheUpdate.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Deferred\CdnCacheUpdate::__construct ( array $targets,
array $options = [] )
Parameters
string[] | PageReference[]$targetsCollection of URLs/titles to be purged from CDN
array$optionsOptions map. Supports:
  • reboundDelay: how many seconds after the first purge to send a rebound purge. No rebound purge will be sent if this is not positive. [Default: 0]

Definition at line 52 of file CdnCacheUpdate.php.

Member Function Documentation

◆ doUpdate()

MediaWiki\Deferred\CdnCacheUpdate::doUpdate ( )

◆ getUrls()

MediaWiki\Deferred\CdnCacheUpdate::getUrls ( )
Returns
string[] List of URLs

Definition at line 151 of file CdnCacheUpdate.php.

◆ merge()

MediaWiki\Deferred\CdnCacheUpdate::merge ( MergeableUpdate $update)

Merge this enqueued update with a new MergeableUpdate of the same qualified class name.

Parameters
MergeableUpdate$updateThe new update (having the same class)

Implements MediaWiki\Deferred\MergeableUpdate.

Definition at line 67 of file CdnCacheUpdate.php.

◆ purge()

static MediaWiki\Deferred\CdnCacheUpdate::purge ( array $urls)
static

Purges a list of CDN nodes defined in $wgCdnServers.

$urlArr should contain the full URLs to purge as values (example: $urlArr[] = 'http://my.host/something')

Parameters
string[]$urlsList of full URLs to purge

Definition at line 109 of file CdnCacheUpdate.php.

References $url, MediaWiki\MainConfigNames\CdnServers, MediaWiki\MediaWikiServices\getInstance(), MediaWiki\MainConfigNames\HTCPRouting, and wfDebugLog().

Referenced by MediaWiki\Deferred\CdnCacheUpdate\doUpdate().


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