https://bugzilla.wikimedia.org/show_bug.cgi?id=71539
Bug ID: 71539
Summary: Static data should go in ResourceLoaderGetConfigVars,
not MakeGlobalVariablesScript
Product: MediaWiki extensions
Version: master
Hardware: All
OS: All
Status: NEW
Keywords: performance
Severity: normal
Priority: Unprioritized
Component: Echo
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected],
[email protected], [email protected],
[email protected]
Web browser: ---
Mobile Platform: ---
For performance reasons, static data should go in ResourceLoaderGetConfigVars,
not MakeGlobalVariablesScript.
The key difference is that static data (ResourceLoaderGetConfigVars) goes in
the startup module and is loaded once (until the startup module is
re-generated/cache expires, then it needs to be downloaded again).
MakeGlobalVariablesScript data is in the source code of every page, so it
should only be used when the data is request-specific. Generally, this may be
specific to the page, user/username, or other aspects of the request.
wgEchoOverlayConfiguration['max-notification-count'] is static (unlike
notification-count), so it should ideally be broken into a separate static
variable.
ResourceLoaderGetConfigVars and wgEchoConfig are also static. However, there's
a complication that wgEchoConfig is set differently when testing. This
exception should be dropped so it can be static, if possible.
The comments should also be updated so it's clear to people which one to use.
--
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l