|
MediaWiki REL1_35
|
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 update with $update. | |
Static Public Member Functions | |
| static | newFromTitles ( $titles, $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[] | $titleTuples = [] |
| List of (Title, 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 28 of file CdnCacheUpdate.php.
| CdnCacheUpdate::__construct | ( | array | $targets, |
| array | $options = [] |
||
| ) |
| string[] | Title[] | $targets | Collection of URLs/titles to be purged from CDN |
| array | $options | Options map. Supports:
|
Definition at line 43 of file CdnCacheUpdate.php.
| CdnCacheUpdate::doUpdate | ( | ) |
Perform the actual work.
Implements DeferrableUpdate.
Definition at line 79 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 335 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 345 of file CdnCacheUpdate.php.
Referenced by HTCPPurge().
| CdnCacheUpdate::getUrls | ( | ) |
Definition at line 154 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 195 of file CdnCacheUpdate.php.
References $wgHTCPMulticastTTL, $wgHTCPRouting, expand(), getRuleForURL(), and wfDebugLog().
Referenced by purge().
| CdnCacheUpdate::merge | ( | MergeableUpdate | $update | ) |
Merge this update with $update.
| MergeableUpdate | $update | Update of the same class type |
Implements MergeableUpdate.
Definition at line 58 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 291 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.
| Traversable | Title[] | $titles | |
| string[] | $urls |
Definition at line 75 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 112 of file CdnCacheUpdate.php.
References $wgCdnServers, $wgHTCPRouting, HTCPPurge(), naivePurge(), and wfDebugLog().
Referenced by BenchmarkPurge\benchCdn(), doUpdate(), and CdnPurgeJob\run().
|
private |
Definition at line 161 of file CdnCacheUpdate.php.
References $title.
Referenced by doUpdate(), and getUrls().
|
private |
List of (Title, rebound purge delay) tuples.
Definition at line 32 of file CdnCacheUpdate.php.
|
private |
List of (URL, rebound purge delay) tuples.
Definition at line 30 of file CdnCacheUpdate.php.