MediaWiki REL1_37
|
Handles purging the appropriate CDN objects given a list of URLs or Title instances. More...
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 | newFromTitles ( $pages, $urls=[]) |
Create an update object from an array of Title objects, or a TitleArray object. | |
static | purge (array $urls) |
Purges a list of CDN nodes defined in $wgCdnServers. | |
Private Member Functions | |
resolveReboundDelayByUrl () | |
Static Private Member Functions | |
static | expand ( $url) |
Expand local URLs to fully-qualified URLs using the internal protocol and host defined in $wgInternalServer. | |
static | getRuleForURL ( $url, $rules) |
Find the HTCP routing rule to use for a given URL. | |
static | HTCPPurge (array $urls) |
Send Hyper Text Caching Protocol (HTCP) CLR requests. | |
static | naivePurge (array $urls) |
Send HTTP PURGE requests for each of the URLs to all of the cache servers. | |
Private Attributes | |
array[] | $pageTuples = [] |
List of (PageReference, rebound purge delay) tuples. | |
array[] | $urlTuples = [] |
List of (URL, rebound purge delay) tuples. | |
Handles purging the appropriate CDN objects given a list of URLs or Title instances.
Definition at line 29 of file CdnCacheUpdate.php.
CdnCacheUpdate::__construct | ( | array | $targets, |
array | $options = [] |
||
) |
string[] | PageReference[] | $targets | Collection of URLs/titles to be purged from CDN |
array | $options | Options map. Supports:
|
Definition at line 44 of file CdnCacheUpdate.php.
CdnCacheUpdate::doUpdate | ( | ) |
Perform the actual work.
Implements DeferrableUpdate.
Definition at line 81 of file CdnCacheUpdate.php.
References purge(), and resolveReboundDelayByUrl().
|
staticprivate |
Expand local URLs to fully-qualified URLs using the internal protocol and host defined in $wgInternalServer.
Input that's already fully- qualified will be passed through unchanged.
This is used to generate purge URLs that may be either local to the main wiki or include a non-native host, such as images hosted on a second internal server.
Client functions should not need to call this.
string | $url |
Definition at line 339 of file CdnCacheUpdate.php.
References PROTO_INTERNAL, and wfExpandUrl().
Referenced by HTCPPurge(), and naivePurge().
|
staticprivate |
Find the HTCP routing rule to use for a given URL.
string | $url | URL to match |
array | $rules | Array of rules, see $wgHTCPRouting for format and behavior |
Definition at line 349 of file CdnCacheUpdate.php.
Referenced by HTCPPurge().
CdnCacheUpdate::getUrls | ( | ) |
Definition at line 156 of file CdnCacheUpdate.php.
References resolveReboundDelayByUrl().
|
staticprivate |
Send Hyper Text Caching Protocol (HTCP) CLR requests.
MWException |
string[] | $urls | Collection of URLs to purge |
Definition at line 199 of file CdnCacheUpdate.php.
References $wgHTCPMulticastTTL, $wgHTCPRouting, expand(), getRuleForURL(), and wfDebugLog().
Referenced by purge().
CdnCacheUpdate::merge | ( | MergeableUpdate | $update | ) |
Merge this enqueued update with a new MergeableUpdate of the same qualified class name.
MergeableUpdate | $update | The new update (having the same class) |
Implements MergeableUpdate.
Definition at line 59 of file CdnCacheUpdate.php.
|
staticprivate |
Send HTTP PURGE requests for each of the URLs to all of the cache servers.
string[] | $urls |
Exception |
Definition at line 295 of file CdnCacheUpdate.php.
References $wgCdnServers, expand(), MW_VERSION, and wfParseUrl().
Referenced by purge().
|
static |
Create an update object from an array of Title objects, or a TitleArray object.
PageReference[] | $pages | |
string[] | $urls |
Definition at line 77 of file CdnCacheUpdate.php.
|
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')
string[] | $urls | List of full URLs to purge |
Definition at line 114 of file CdnCacheUpdate.php.
References $wgCdnServers, $wgHTCPRouting, HTCPPurge(), naivePurge(), and wfDebugLog().
Referenced by BenchmarkPurge\benchCdn(), doUpdate(), and CdnPurgeJob\run().
|
private |
Definition at line 163 of file CdnCacheUpdate.php.
Referenced by doUpdate(), and getUrls().
|
private |
List of (PageReference, rebound purge delay) tuples.
Definition at line 33 of file CdnCacheUpdate.php.
|
private |
List of (URL, rebound purge delay) tuples.
Definition at line 31 of file CdnCacheUpdate.php.