X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fpage%2FWikiPage.php;h=8cc5a39b5111fedc0218e1b36ac55b691a0ce207;hb=8b7e2605e62c45da4a9367a2a80a6a5b8d3e584e;hp=1ff91012eccc515afc27e2796da8e3914d6e1835;hpb=3bd96b883843816ab2e3eca75a0b65163ff594b0;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php index 1ff91012ec..8cc5a39b51 100644 --- a/includes/page/WikiPage.php +++ b/includes/page/WikiPage.php @@ -1300,8 +1300,13 @@ class WikiPage implements Page, IDBAccessObject { $this->mTitle->invalidateCache(); - // Clear file cache and send purge after above page_touched update was committed - MediaWikiServices::getInstance()->getHtmlCacheUpdater()->purge( $this->mTitle ); + // Clear file cache + HTMLFileCache::clearFileCache( $this->getTitle() ); + // Send purge after above page_touched update was committed + DeferredUpdates::addUpdate( + new CdnCacheUpdate( $this->mTitle->getCdnUrls() ), + DeferredUpdates::PRESEND + ); if ( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) { $messageCache = MessageCache::singleton(); @@ -3386,20 +3391,18 @@ class WikiPage implements Page, IDBAccessObject { // Update existence markers on article/talk tabs... $other = $title->getOtherPage(); - MediaWikiServices::getInstance()->getHtmlCacheUpdater()->purge( [ $title, $other ] ); + $other->purgeSquid(); $title->touchLinks(); + $title->purgeSquid(); $title->deleteTitleProtection(); MediaWikiServices::getInstance()->getLinkCache()->invalidateTitle( $title ); // Invalidate caches of articles which include this page - $job = HTMLCacheUpdateJob::newForBacklinks( - $title, - 'templatelinks', - [ 'causeAction' => 'page-create' ] + DeferredUpdates::addUpdate( + new HTMLCacheUpdate( $title, 'templatelinks', 'page-create' ) ); - JobQueueGroup::singleton()->lazyPush( $job ); if ( $title->getNamespace() == NS_CATEGORY ) { // Load the Category object, which will schedule a job to create @@ -3419,14 +3422,19 @@ class WikiPage implements Page, IDBAccessObject { // TODO: move this into a PageEventEmitter service // Update existence markers on article/talk tabs... + // Clear Backlink cache first so that purge jobs use more up-to-date backlink information + BacklinkCache::get( $title )->clear(); $other = $title->getOtherPage(); - MediaWikiServices::getInstance()->getHtmlCacheUpdater()->purge( [ $title, $other ] ); + $other->purgeSquid(); $title->touchLinks(); + $title->purgeSquid(); MediaWikiServices::getInstance()->getLinkCache()->invalidateTitle( $title ); + // File cache + HTMLFileCache::clearFileCache( $title ); InfoAction::invalidateCache( $title ); // Messages @@ -3436,12 +3444,9 @@ class WikiPage implements Page, IDBAccessObject { // Images if ( $title->getNamespace() == NS_FILE ) { - $job = HTMLCacheUpdateJob::newForBacklinks( - $title, - 'imagelinks', - [ 'causeAction' => 'page-delete' ] + DeferredUpdates::addUpdate( + new HTMLCacheUpdate( $title, 'imagelinks', 'page-delete' ) ); - JobQueueGroup::singleton()->lazyPush( $job ); } // User talk pages @@ -3474,28 +3479,26 @@ class WikiPage implements Page, IDBAccessObject { ) { // TODO: move this into a PageEventEmitter service - $jobs = []; - if ( $slotsChanged === null || in_array( SlotRecord::MAIN, $slotsChanged ) ) { + if ( $slotsChanged === null || in_array( SlotRecord::MAIN, $slotsChanged ) ) { // Invalidate caches of articles which include this page. // Only for the main slot, because only the main slot is transcluded. // TODO: MCR: not true for TemplateStyles! [SlotHandler] - $jobs[] = HTMLCacheUpdateJob::newForBacklinks( - $title, - 'templatelinks', - [ 'causeAction' => 'page-edit' ] + DeferredUpdates::addUpdate( + new HTMLCacheUpdate( $title, 'templatelinks', 'page-edit' ) ); } + // Invalidate the caches of all pages which redirect here - $jobs[] = HTMLCacheUpdateJob::newForBacklinks( - $title, - 'redirect', - [ 'causeAction' => 'page-edit' ] + DeferredUpdates::addUpdate( + new HTMLCacheUpdate( $title, 'redirect', 'page-edit' ) ); - JobQueueGroup::singleton()->lazyPush( $jobs ); MediaWikiServices::getInstance()->getLinkCache()->invalidateTitle( $title ); - MediaWikiServices::getInstance()->getHtmlCacheUpdater()->purge( $title ); + // Purge CDN for this page only + $title->purgeSquid(); + // Clear file cache for this page only + HTMLFileCache::clearFileCache( $title ); // Purge ?action=info cache $revid = $revision ? $revision->getId() : null;