HTMLCacheUpdateJob: Enable PURGE_URLS_LINKSUPDATE_ONLY to reduce purges

* Pass $flags down from purgeTitleUrls() to getUrls().

* Avoid purging of action=history URLs (and its mobile variant,
  if MobileFrontend is installed) when the purge is only for a
  recursive LinksUpdate.

Bug: T250261
Change-Id: I1a05ae028b9b44ec8d66211f94e64c7e3f48d6ff
This commit is contained in:
Timo Tijhof 2020-04-16 22:05:01 +01:00 committed by Krinkle
parent 2f35c3ae67
commit 3a69f9bb29
2 changed files with 6 additions and 3 deletions

View file

@ -130,7 +130,7 @@ class HtmlCacheUpdater {
$urls = [];
foreach ( $titles as $title ) {
/** @var Title $title */
$urls = array_merge( $urls, $title->getCdnUrls() );
$urls = array_merge( $urls, $this->getUrls( $title, $flags ) );
}
$this->purgeUrls( $urls, $flags );
}

View file

@ -158,8 +158,11 @@ class HTMLCacheUpdateJob extends Job {
) );
// Update CDN and file caches (avoiding secondary purge overhead)
$hcu = MediaWikiServices::getInstance()->getHtmlCacheUpdater();
$hcu->purgeTitleUrls( $titleArray, $hcu::PURGE_NAIVE );
$htmlCache = MediaWikiServices::getInstance()->getHtmlCacheUpdater();
$htmlCache->purgeTitleUrls(
$titleArray,
$htmlCache::PURGE_NAIVE | $htmlCache::PURGE_URLS_LINKSUPDATE_ONLY
);
}
public function getDeduplicationInfo() {