$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();
// 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
// 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
// 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
) {
// 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;