Details
-
Improvement
-
Resolution: Fixed
-
Major
-
1.8.2
-
None
-
Solaris 5.11
Apache 6.0.18
Java 1.6.0_14
Firefox 3.0.6
-
javascript paralle download patch
-
Trivial
-
Description
In line the number one 'Improve and Polish' objective from
http://www.xwiki.org/xwiki/bin/view/Blog/CurrentSurveyResults
I thought I'd highlight something which was uncovered during the test
deployment of XWiki 1.8.2.
We had several reports of the site being slow to load, which on further
investigation was probably due to Javascript blocking. See
http://www.stevesouders.com/blog/2009/04/27/loading-scripts-without-blocking/
for a discussion.
I used Firebug to observe the serialisation, and then simply edited
javascript.vm to use the DOM element technique outlined here
http://stevesouders.com/cuzillion/help.php#examples
to give
<script type="text/javascript"> var script1 = document.createElement('script') script1.src = "$xwiki.getSkinFile("js/prototype/prototype.js")" var script2 = document.createElement('script') script2.src = "$xwiki.getSkinFile("js/xwiki/xwiki.js", true)" var script3 = document.createElement('script') script3.src = "$xwiki.getSkinFile("js/xwiki/suggest/ajaxSuggest.js")" document.getElementsByTagName('head')[0].appendChild(script1); document.getElementsByTagName('head')[0].appendChild(script2); document.getElementsByTagName('head')[0].appendChild(script3); </script>
This appears to provide parallel loading and hence faster page loads.
I have not, as yet, done this for all javascript.
Is there a better category to log this under?
Attachments
Issue Links
- depends on
-
XSKINX-35 Improve page load speeds via parallel JavaScript download
- Closed
- is related to
-
XWIKI-2022 Improve page loading times
- Closed