Merge "resourceloader: Remove internal 'wgResourceLoaderStorageEnabled' from mw.config"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Fri, 26 Jul 2019 20:24:18 +0000 (20:24 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 26 Jul 2019 20:24:18 +0000 (20:24 +0000)
includes/resourceloader/ResourceLoaderStartUpModule.php
resources/src/startup/mediawiki.js

index 7880f6f..f0ef25a 100644 (file)
@@ -105,7 +105,6 @@ class ResourceLoaderStartUpModule extends ResourceLoaderModule {
                        'wgCaseSensitiveNamespaces' => $caseSensitiveNamespaces,
                        'wgLegalTitleChars' => Title::convertByteClassToUnicodeClass( Title::legalChars() ),
                        'wgIllegalFileChars' => Title::convertByteClassToUnicodeClass( $illegalFileChars ),
-                       'wgResourceLoaderStorageEnabled' => $conf->get( 'ResourceLoaderStorageEnabled' ),
                        'wgForeignUploadTargets' => $conf->get( 'ForeignUploadTargets' ),
                        'wgEnableUploads' => $conf->get( 'EnableUploads' ),
                        'wgCommentByteLimit' => null,
@@ -422,6 +421,11 @@ class ResourceLoaderStartUpModule extends ResourceLoaderModule {
                        '$VARS.maxQueryLength' => ResourceLoader::encodeJsonForScript(
                                $conf->get( 'ResourceLoaderMaxQueryLength' )
                        ),
+                       // The client-side module cache can be disabled by site configuration.
+                       // It is also always disabled in debug mode.
+                       '$VARS.storeEnabled' => ResourceLoader::encodeJsonForScript(
+                               $conf->get( 'ResourceLoaderStorageEnabled' ) && !$context->getDebug()
+                       ),
                        '$VARS.storeKey' => ResourceLoader::encodeJsonForScript( $this->getStoreKey() ),
                        '$VARS.storeVary' => ResourceLoader::encodeJsonForScript( $this->getStoreVary( $context ) ),
                ];
index 2081bfe..b2a8f5b 100644 (file)
                                                }
 
                                                if (
+                                                       !$VARS.storeEnabled ||
+
                                                        // Disabled because localStorage quotas are tight and (in Firefox's case)
                                                        // shared by multiple origins.
                                                        // See T66721, and <https://bugzilla.mozilla.org/show_bug.cgi?id=1064466>.
-                                                       /Firefox/.test( navigator.userAgent ) ||
-
-                                                       // Disabled by configuration.
-                                                       !mw.config.get( 'wgResourceLoaderStorageEnabled' ) ||
-
-                                                       // Disable module store in debug mode context
-                                                       mw.config.get( 'debug' )
+                                                       /Firefox/.test( navigator.userAgent )
                                                ) {
                                                        // Clear any previous store to free up space. (T66721)
                                                        this.clear();