Module storage: set stricter storage quotas on Firefox
authorOri Livneh <ori@wikimedia.org>
Mon, 11 Jan 2016 20:52:32 +0000 (12:52 -0800)
committerOri Livneh <ori@wikimedia.org>
Mon, 11 Jan 2016 20:52:32 +0000 (12:52 -0800)
The 100 kB limit is being effectively circumvented by the fact that
heavy-hitters like VisualEditor are now split up into a greater number
of smaller modules. We can improve matters further by making the per-module
size limit smaller on Firefox, where the quota is especially tight due to
<https://bugzilla.mozilla.org/show_bug.cgi?id=1064466>.

Bug: T66721
Change-Id: Ia1bb1e0b834af4280989cec5ba382ff2b3c50237

resources/src/mediawiki/mediawiki.js

index c25e327..82b4588 100644 (file)
                                        // Whether the store is in use on this page.
                                        enabled: null,
 
-                                       // Modules whose string representation exceeds 100 kB are ineligible
-                                       // for storage due to bug T66721.
-                                       MODULE_SIZE_MAX: 100000,
+                                       // 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,
 
                                        // The contents of the store, mapping '[module name]@[version]' keys
                                        // to module implementations.