resourceloader: Disable localStorage cache on FF, Opera
authorOri Livneh <ori@wikimedia.org>
Wed, 10 Feb 2016 08:25:41 +0000 (00:25 -0800)
committerKrinkle <krinklemail@gmail.com>
Wed, 10 Feb 2016 12:24:22 +0000 (12:24 +0000)
Bug T66721 affects a minority of users on a minority of browsers. But for those
people, the effect is sufficiently severe to be considered a deal-breaker. I
regret that it has taken me this long to come around to recognizing that.

Bug: T66721
Change-Id: Iedde8a399c1eec81ed6307748048b3c1bdfe7adc

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;