ResourceLoader: make cacheReport option false by default

In the three years or so that I have been around, we at Wikimedia have not to
my knowledge used the cache keys to manage the cache of ResourceLoader modules.
Instead, if we want to force a module to rebuild, we simply touch one of its
files. (Though even that is not often required these days.)

Change-Id: Ib62a792e053572f268d4be19a10f99f84c07abc5
This commit is contained in:
Ori Livneh 2015-08-11 09:24:03 -07:00
parent 5d9fe1ec34
commit 471a3bfb3d
2 changed files with 5 additions and 5 deletions

View file

@ -181,7 +181,7 @@ class ResourceLoader implements LoggerAwareInterface {
* @param string $data Text to filter, such as JavaScript or CSS text
* @param array $options For back-compat, can also be the boolean value for "cacheReport". Keys:
* - (bool) cache: Whether to allow caching this data. Default: true.
* - (bool) cacheReport: Whether to include the "cache key" report comment. Default: true.
* - (bool) cacheReport: Whether to include the "cache key" report comment. Default: false.
* @return string Filtered data, or a comment containing an error message
*/
public function filter( $filter, $data, $options = array() ) {
@ -190,7 +190,7 @@ class ResourceLoader implements LoggerAwareInterface {
$options = array( 'cacheReport' => $options );
}
// Defaults
$options += array( 'cache' => true, 'cacheReport' => true );
$options += array( 'cache' => true, 'cacheReport' => false );
// Don't filter empty content
if ( trim( $data ) === '' ) {

View file

@ -162,15 +162,15 @@ class OutputPageTest extends MediaWikiTestCase {
array( 'test.quux', ResourceLoaderModule::TYPE_SCRIPTS ),
"<script>window.RLQ = window.RLQ || []; window.RLQ.push( function () {\n"
. "mw.test.baz({token:123});mw.loader.state({\"test.quux\":\"ready\"});\n"
. "\n} );</script>"
. "} );</script>"
),
// Load private module (combined)
array(
array( 'test.quux', ResourceLoaderModule::TYPE_COMBINED ),
"<script>window.RLQ = window.RLQ || []; window.RLQ.push( function () {\n"
. "mw.loader.implement(\"test.quux\",function($,jQuery){"
. "mw.test.baz({token:123});},{\"css\":[\".mw-icon{transition:none}\\n"
. "\"]});\n\n} );</script>"
. "mw.test.baz({token:123});},{\"css\":[\".mw-icon{transition:none}"
. "\"]});\n} );</script>"
),
// Load no modules
array(