Hi everyone!
Is it possible to load jQuery from google library?
Currently, for MW 1.24 the jQuery 1.11.1 were loaded by ResourceLoader. I want to replace it with https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js wich should increase site speed.
Any comment will be helpful. Thank you!
-- Bask Ice E-mail ice@moegirl.org Moegirlpedia 2290 3rd Avenue Basement, New York, United States
No it's not possible.
RL does not load libraries individually, it minifies and concatenates the JS it loads together into combined requests.
Because of that, even if you could, loading jQuery from Google would not speed up your site. You would end up introducing an additional HTTP request that would just slow down the loading since the request that jQuery would be bundled in to would still have other scripts to load and additional HTTP requests are worse for performance than transmitting extra data within a single request
~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://danielfriesen.name/]
On 2015-04-26 3:26 PM, 晒太阳的冰 wrote:
Hi everyone!
Is it possible to load jQuery from google library?
Currently, for MW 1.24 the jQuery 1.11.1 were loaded by ResourceLoader. I want to replace it with https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js wich should increase site speed.
Any comment will be helpful. Thank you!
-- Bask Ice E-mail ice@moegirl.org Moegirlpedia 2290 3rd Avenue Basement, New York, United States _______________________________________________ MediaWiki-l mailing list To unsubscribe, go to: https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
No it's not possible.
RL does not load libraries individually, it minifies and concatenates the JS it loads together into combined requests.
Because of that, even if you could, loading jQuery from Google would not speed up your site. You would end up introducing an additional HTTP request that would just slow down the loading since the request that jQuery would be bundled in to would still have other scripts to load and additional HTTP requests are worse for performance than transmitting extra data within a single request
~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://danielfriesen.name/]
On 2015-04-26 3:26 PM, 晒太阳的冰 wrote:
Hi everyone!
Is it possible to load jQuery from google library?
Currently, for MW 1.24 the jQuery 1.11.1 were loaded by ResourceLoader. I want to replace it with https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js wich should increase site speed.
Any comment will be helpful. Thank you!
-- Bask Ice E-mail ice@moegirl.org Moegirlpedia 2290 3rd Avenue Basement, New York, United States _______________________________________________ MediaWiki-l mailing list To unsubscribe, go to: https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Hi Daniel, Thank you for your response. I guess it is still possible if I modify the mediawiki's core file.
I guess the jQuery were load alone. Example: http://bits.moegirl.org/zh/load.php?debug=false&lang=zh-cn&modules=j...
And I could add external js by function addjQuery(){ global $wgOut; $wgOut->addHeadItem ( .............
The possible problem here is that ResourceLoader might collapse without native jQuery. Also, I have no idea how jQuery were loaded with ResourceLoader .
On Sun, Apr 26, 2015 at 5:32 PM, Daniel Friesen daniel@nadir-seen-fire.com wrote:
No it's not possible.
RL does not load libraries individually, it minifies and concatenates the JS it loads together into combined requests.
Because of that, even if you could, loading jQuery from Google would not speed up your site. You would end up introducing an additional HTTP request that would just slow down the loading since the request that jQuery would be bundled in to would still have other scripts to load and additional HTTP requests are worse for performance than transmitting extra data within a single request
~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://danielfriesen.name/]
On 2015-04-26 3:26 PM, 晒太阳的冰 wrote:
Hi everyone!
Is it possible to load jQuery from google library?
Currently, for MW 1.24 the jQuery 1.11.1 were loaded by ResourceLoader. I want to replace it with https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js wich should increase site speed.
Any comment will be helpful. Thank you!
-- Bask Ice E-mail ice@moegirl.org Moegirlpedia 2290 3rd Avenue Basement, New York, United States _______________________________________________ MediaWiki-l mailing list To unsubscribe, go to: https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list To unsubscribe, go to: https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
On 2015-04-26 3:50 PM, 晒太阳的冰 wrote:
Hi Daniel, Thank you for your response. I guess it is still possible if I modify the mediawiki's core file.
I guess the jQuery were load alone. Example: http://bits.moegirl.org/zh/load.php?debug=false&lang=zh-cn&modules=j...
That is not jQuery alone. That is request contains two modules, 'jquery' and 'mediawiki'. The latter being the `mw` base library, the loader that handles loading of all other modules, and mw.log stub.
Even if you got rid of jQuery loading this would still need to be loaded since it's the base MW code that is required for EVERY single other module MediaWiki uses requires.
And I could add external js by function addjQuery(){ global $wgOut; $wgOut->addHeadItem ( .............
The possible problem here is that ResourceLoader might collapse without native jQuery. Also, I have no idea how jQuery were loaded with ResourceLoader .
All that'll do is load an additional and conflicting jQuery slowing down your site. It likely won't be in the correct order (that 'mediawiki' library requires jQuery which would have to be loaded before it). And if that head element is inserted in between a module that adds extra things to jQuery (like a jQuery plugin or our 'jquery.mediawiki' extras) and another module that depends on those extras it will trample the global jQuery with a version that doesn't have those additions and break every module afterwards that depends on them.
~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://danielfriesen.name/]
mediawiki-l@lists.wikimedia.org