Add small HtmlCacheUpdater service class to normalize purging code
authorAaron Schulz <aschulz@wikimedia.org>
Fri, 15 Mar 2019 00:23:26 +0000 (17:23 -0700)
committerJames D. Forrester <jforrester@wikimedia.org>
Tue, 6 Aug 2019 20:45:27 +0000 (13:45 -0700)
commit35da1bbd7cb8b4414c4fbcf331473f1024bc638d
treef903765d437301b1bff67ebea4fd895ce64132d9
parenta6b45d2a20c9be095431ac60ba0a4f5951b5f387
Add small HtmlCacheUpdater service class to normalize purging code

The purge() method handles purging of both file cache and CDN, using
a PRESEND deferred update. This avoids code duplication and missing
file cache purge calls.

Also:
* Migrate HTMLCacheUpdate callers to just directly using HTMLCacheUpdateJob
* Add HtmlFileCacheUpdate class and defer such updates just like with CDN
* Simplify HTMLCacheUpdate constructor parameters
* Remove BacklinkCache::clear() calls which do nothing since the backlink
  query does not actually happen until the job runs

Change-Id: Ic453b189a40109a73a9426538608eea87a76befa
19 files changed:
RELEASE-NOTES-1.34
autoload.php
includes/MediaWikiServices.php
includes/ServiceWiring.php
includes/Title.php
includes/cache/HTMLFileCache.php
includes/cache/HtmlCacheUpdater.php [new file with mode: 0644]
includes/deferred/CdnCacheUpdate.php
includes/deferred/HTMLCacheUpdate.php
includes/deferred/HtmlFileCacheUpdate.php [new file with mode: 0644]
includes/deferred/LinksUpdate.php
includes/filerepo/file/File.php
includes/filerepo/file/LocalFile.php
includes/jobqueue/jobs/HTMLCacheUpdateJob.php
includes/page/PageArchive.php
includes/page/WikiFilePage.php
includes/page/WikiPage.php
includes/revisiondelete/RevDelFileList.php
includes/revisiondelete/RevDelRevisionList.php