resourceloader: Add filter cache version to module version hash
authorRoan Kattouw <roan.kattouw@gmail.com>
Fri, 29 Sep 2017 20:35:00 +0000 (13:35 -0700)
committerKrinkle <krinklemail@gmail.com>
Mon, 24 Sep 2018 17:10:48 +0000 (17:10 +0000)
commit1ed0a109ec00c3230da17713d438e1f5d275f7d1
tree4f48116d95ab87c6c0a6af54a4256766567aa11b
parent450da07f3a39c16a7ec71a9f0e2f08100cbe6716
resourceloader: Add filter cache version to module version hash

We already had a $filterCacheVersion variable, but it was
only used for the internal cache for JS and CSS minification,
which is not enough. If there is a breaking change in either
of these processes, we also need to invalidate version hashes.

This commit renames ResourceLoader::$filterCacheVersion to
ResourceLoader::CACHE_VERSION and takes it into account in
getVersionHash(). Adding it to getDefinitionSummary() is not
sufficient, because content-hashed modules also need to be
invalidated when there's a breaking change in the minifiers.

This cache version can also be incremented when there's a
breaking change in image embedding or LESS compilation,
although content hashing deals with that already, so we
could also add a separate cache version for those that's
only added to getDefinitionSummary().

Bug: T176884
Change-Id: Ife6efa71f310c90b9951afa02212b2cb6766e76d
includes/resourceloader/ResourceLoader.php
includes/resourceloader/ResourceLoaderModule.php
tests/phpunit/includes/OutputPageTest.php