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:
parent
5d9fe1ec34
commit
471a3bfb3d
2 changed files with 5 additions and 5 deletions
|
|
@ -181,7 +181,7 @@ class ResourceLoader implements LoggerAwareInterface {
|
||||||
* @param string $data Text to filter, such as JavaScript or CSS text
|
* @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:
|
* @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) 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
|
* @return string Filtered data, or a comment containing an error message
|
||||||
*/
|
*/
|
||||||
public function filter( $filter, $data, $options = array() ) {
|
public function filter( $filter, $data, $options = array() ) {
|
||||||
|
|
@ -190,7 +190,7 @@ class ResourceLoader implements LoggerAwareInterface {
|
||||||
$options = array( 'cacheReport' => $options );
|
$options = array( 'cacheReport' => $options );
|
||||||
}
|
}
|
||||||
// Defaults
|
// Defaults
|
||||||
$options += array( 'cache' => true, 'cacheReport' => true );
|
$options += array( 'cache' => true, 'cacheReport' => false );
|
||||||
|
|
||||||
// Don't filter empty content
|
// Don't filter empty content
|
||||||
if ( trim( $data ) === '' ) {
|
if ( trim( $data ) === '' ) {
|
||||||
|
|
|
||||||
|
|
@ -162,15 +162,15 @@ class OutputPageTest extends MediaWikiTestCase {
|
||||||
array( 'test.quux', ResourceLoaderModule::TYPE_SCRIPTS ),
|
array( 'test.quux', ResourceLoaderModule::TYPE_SCRIPTS ),
|
||||||
"<script>window.RLQ = window.RLQ || []; window.RLQ.push( function () {\n"
|
"<script>window.RLQ = window.RLQ || []; window.RLQ.push( function () {\n"
|
||||||
. "mw.test.baz({token:123});mw.loader.state({\"test.quux\":\"ready\"});\n"
|
. "mw.test.baz({token:123});mw.loader.state({\"test.quux\":\"ready\"});\n"
|
||||||
. "\n} );</script>"
|
. "} );</script>"
|
||||||
),
|
),
|
||||||
// Load private module (combined)
|
// Load private module (combined)
|
||||||
array(
|
array(
|
||||||
array( 'test.quux', ResourceLoaderModule::TYPE_COMBINED ),
|
array( 'test.quux', ResourceLoaderModule::TYPE_COMBINED ),
|
||||||
"<script>window.RLQ = window.RLQ || []; window.RLQ.push( function () {\n"
|
"<script>window.RLQ = window.RLQ || []; window.RLQ.push( function () {\n"
|
||||||
. "mw.loader.implement(\"test.quux\",function($,jQuery){"
|
. "mw.loader.implement(\"test.quux\",function($,jQuery){"
|
||||||
. "mw.test.baz({token:123});},{\"css\":[\".mw-icon{transition:none}\\n"
|
. "mw.test.baz({token:123});},{\"css\":[\".mw-icon{transition:none}"
|
||||||
. "\"]});\n\n} );</script>"
|
. "\"]});\n} );</script>"
|
||||||
),
|
),
|
||||||
// Load no modules
|
// Load no modules
|
||||||
array(
|
array(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue