use MediaWiki\MediaWikiServices;
/**
- * Job to purge the cache for all pages that link to or use another page or file
+ * Job to purge the HTML/file cache for all pages that link to or use another page or file
*
* This job comes in a few variants:
* - a) Recursive jobs to purge caches for backlink pages for a given title.
* @param array $pages Map of (page ID => (namespace, DB key)) entries
*/
protected function invalidateTitles( array $pages ) {
- global $wgUpdateRowsPerQuery, $wgUseFileCache, $wgPageLanguageUseDB;
+ global $wgUpdateRowsPerQuery, $wgPageLanguageUseDB;
// Get all page IDs in this query into an array
$pageIds = array_keys( $pages );
__METHOD__
) );
- // Update CDN; call purge() directly so as to not bother with secondary purges
- $urls = [];
- foreach ( $titleArray as $title ) {
- /** @var Title $title */
- $urls = array_merge( $urls, $title->getCdnUrls() );
- }
- CdnCacheUpdate::purge( $urls );
-
- // Update file cache
- if ( $wgUseFileCache ) {
- foreach ( $titleArray as $title ) {
- HTMLFileCache::clearFileCache( $title );
- }
- }
+ // Update CDN and file caches (avoiding secondary purge overhead)
+ MediaWikiServices::getInstance()->getHtmlCacheUpdater()->purge(
+ $titleArray,
+ HtmlCacheUpdater::IMMEDIATE_WITHOUT_REBOUND
+ );
}
public function getDeduplicationInfo() {