Merge "resourceloader: Disable localStorage cache on FF, Opera"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 10 Feb 2016 15:59:18 +0000 (15:59 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 10 Feb 2016 15:59:18 +0000 (15:59 +0000)
resources/src/mediawiki/mediawiki.js

index 90b93dc..2aada9e 100644 (file)
                                        // Whether the store is in use on this page.
                                        enabled: null,
 
-                                       // Modules whose string representation exceeds 100 kB (30 kB on FF) are
-                                       // ineligible for storage due to bug T66721. The quota is stricter on
-                                       // Firefox due to <https://bugzilla.mozilla.org/show_bug.cgi?id=1064466>.
-                                       MODULE_SIZE_MAX: ( /Firefox/.test( navigator.userAgent ) ? 30 : 100 ) * 1000,
+                                       MODULE_SIZE_MAX: 100 * 1000,
 
                                        // The contents of the store, mapping '[module name]@[version]' keys
                                        // to module implementations.
                                                        return;
                                                }
 
-                                               if ( !mw.config.get( 'wgResourceLoaderStorageEnabled' ) ) {
+                                               if (
+                                                       // 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|Opera/.test( navigator.userAgent ) ||
+
                                                        // Disabled by configuration.
+                                                       !mw.config.get( 'wgResourceLoaderStorageEnabled' )
+                                               ) {
                                                        // Clear any previous store to free up space. (T66721)
                                                        mw.loader.store.clear();
                                                        mw.loader.store.enabled = false;