DifferenceEngine: Improve cache invalidation
authorKunal Mehta <legoktm@member.fsf.org>
Sat, 4 Nov 2017 20:15:26 +0000 (13:15 -0700)
committerWMDE-Fisch <christoph.jauera@wikimedia.de>
Tue, 21 Nov 2017 11:10:11 +0000 (12:10 +0100)
commit23ebfcddc47ffb648154398147ad1b7bc7c20761
treec8c9685a25a095fdaaaa5974947bcf8a487c75c0
parent67072948b6210b836e864ed6096b16027caeb300
DifferenceEngine: Improve cache invalidation

Invalidate the diff cache if the engine producing the diff changes, or
if a configuration setting that controls the diff output changes. This
is probably what most users expect, that changing the configuration will
result in a change for diffs that may have already been viewed.

For wikidiff2 specifically, a change in version or
$wgWikiDiff2MovedParagraphDetectionCutoff will invalidate the cache.

Refactor engine detection and sanity-checking into a private getEngine()
function.

As part of this getDiffBodyCacheKey() was deprecated, and subclasses
should implement getDiffBodyCacheKeyParams() instead. Drop the
deprecated and unused MW_DIFF_VERSION constant while we're at it, and
bump DIFF_VERSION since we're already changing the cache key format.

Bug: T180043
Change-Id: I4e386ca05bd2a2fb54208d760c131eb42e3a72ab
RELEASE-NOTES-1.31
includes/diff/DifferenceEngine.php