resourceloader: Don't cache stale responses in mw.loader.store
authorTimo Tijhof <krinklemail@gmail.com>
Mon, 12 Sep 2016 20:52:10 +0000 (13:52 -0700)
committerOri.livneh <ori@wikimedia.org>
Mon, 10 Oct 2016 19:48:25 +0000 (19:48 +0000)
commit45bec7675547ee7076a2ac899db5e2e9199c5fad
tree327e19afb97732b626fe42db6418c1ad6d672d5b
parent1b2b4b1b6b947866af7db06d43cf44f1865556f9
resourceloader: Don't cache stale responses in mw.loader.store

Follows-up 6fa1e56. This is already fixed for http caches by
shortening the Cache-Control max-age in case of a version mismatch.

However the client still cached it blindly in mw.loader.store.
Resolve this by communicating to the client what version of the module
was exported. The client can then compare this version to the version
it originally requested and decide not to cache it.

Adopt the module key format (name@version) from mw.loader.store
in mw.loader.implement() as well.

Bug: T117587
Change-Id: I1a7c44d0222893afefac20bef507bdd1a1a87ecd
includes/resourceloader/ResourceLoader.php
resources/src/mediawiki/mediawiki.js
tests/phpunit/ResourceLoaderTestCase.php
tests/phpunit/includes/resourceloader/ResourceLoaderClientHtmlTest.php
tests/phpunit/includes/resourceloader/ResourceLoaderStartUpModuleTest.php
tests/qunit/suites/resources/mediawiki/mediawiki.loader.test.js