History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: XWIKI-2022
Type: Improvement Improvement
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Vincent Massol
Votes: 3
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
XWiki Core

Improve page loading times

Created: 21/Jan/08 22:18   Updated: 09/Jul/08 15:36
Component/s: Templates & User Interface
Affects Version/s: 1.2
Fix Version/s: 1.6 M1

File Attachments: 1. Text File XWIKI-2022___Improve_page_loading_times.patch (4 kb)

Image Attachments:

1. yslow.png
(24 kb)
Issue Links:
Related
 

Date of First Response: 22/Jan/08 12:18


 Description  « Hide
Over time the xwiki skins in general have added JS, CSS, images. This is making xwiki pages slow to load as shown by YSlow (see attached image).

What we should do:

  • Reduce the number of JS to load by moving out JS that are not needed for all pages so that they are loaded on demand
  • GZip all HTTP response contents
  • Modify the build to automatically merge all CSS and JS files together in a single file (see http://aciddrop.com/2008/01/03/automatically-join-your-javascript-and-css-into-a-single-file/)
  • Add expire headers. We need to be careful with this and probably do what yahoo recommends: modify the file names when they change so that clients get the newer versions. Otherwise they'll need to remember to refresh their caches. This can be automated in the build and should be pretty easy especially if we merge all files into a single one.
  • Minify CSS and JS files


 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Vincent Massol - 21/Jan/08 22:19
I'm scheduling for 1.3M1 for now even though I'm not sure who'll have the time to work on this. It's quite an important issue though hence the move to 1.3M1.

Vincent Massol - 21/Jan/08 22:20
Note: The YSlow stats were from the home page of xwiki.org

Vincent Massol - 22/Jan/08 08:41
It also seems that for some reason the style.css file is loaded twice for each page invocation. Need to find out why and remove the second loading.

Sergiu Dumitriu - 22/Jan/08 12:18



Vincent Massol - 31/Jan/08 16:42
The reason style.css is loaded twice is because we have this definition in stylesheet.vm:
<link href="$defaultStyleURL" rel="stylesheet" type="text/css" />
<link href="$defaultStyleURL" rel="stylesheet" type="text/css" title="default" />

This seems to be required (to be validated) because some browsers may not support alternate stylesheets properly... To be investigated.

Reference:
http://www.w3.org/TR/html401/present/styles.html


Sergiu Dumitriu - 31/Jan/08 18:23

Vincent Massol - 04/Feb/08 17:38
An interesting framework to research: Jawr, see http://www.theserverside.com/news/thread.tss?thread_id=48318

Vincent Massol - 06/Feb/08 09:13
Interesting loading stats at http://ejohn.org/blog/library-loading-speed/


Jean-Vincent Drean - 25/Feb/08 19:27
javascripts.vm and stylesheets.vm doesn't use XWiki.getSkinFile with the forceSkinAction flag everytime (with this action the response expiration is always set to 1 month). Patch attached.
WDYT ?

Sergiu Dumitriu - 25/Feb/08 19:31
I tried to do that once, and I got some velocity exceptions. I think that SkinAction should not parse all the js/css files it sends, but use a request parameter (something like "?parse=true").

Sergiu Dumitriu - 29/Feb/08 18:40
This can be applied now, as the parse error has been fixed. See XSALBATROSS-18

Vincent Massol - 15/Mar/08 10:18
See also: http://feeds.feedburner.com/~r/blogspot/Dcni/~3/251619119/how-we-improved-performance-on-google.html
of interest:
  • concatenate images into one
  • lazy loading of js


Vincent Massol - 01/May/08 21:28
http://feeds.feedburner.com/~r/oreilly/radar/atom/~3/281377463/more-on-high-performance-websi.html
  • Split the initial payload
  • Load scripts without blocking
  • Don't scatter scripts
  • Split dominant content domains
  • Make static content cookie-free
  • Reduce cookie weight
  • Minify CSS
  • Optimize images
  • Use iframes sparingly
  • To www or not to www


Jordi Hernandez Sellés - 10/Jun/08 12:33
Hi, I'm the lead developer of Jawr (https://jawr.dev.java.net), which vincent pointed to in a previous comment. If you need any further information to decide wether you should use it, or want me to help out in integrating it let me know. I'll be happy to help