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.

Vincent Massol
added a comment - 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
added a comment - 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
added a comment - 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").

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

Jordi Hernandez Sellés
added a comment - 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

As you can see from the image (Main.Sandbox-PageSpeed.png) javascript is by far the biggest time waster, I also consider it to be "low hanging fruit" as far as performance improvements go.
Note: this test was run with the browser cache turned off.
Perhaps we could concatenate all of the scripts together at runtime?

CalebJamesDeLisle
added a comment - 03/Oct/09 08:15 As you can see from the image (Main.Sandbox-PageSpeed.png) javascript is by far the biggest time waster, I also consider it to be "low hanging fruit" as far as performance improvements go.
Note: this test was run with the browser cache turned off.
Perhaps we could concatenate all of the scripts together at runtime?

Vincent Massol
added a comment - 10/Nov/09 08:58 - edited New suggestion: use wro4j: http://code.google.com/p/wro4j/
(see also http://raibledesigns.com/rd/entry/javascript_and_css_concatenation )
See the discussion thread at:
http://markmail.org/thread/hpu6dm7y3b3uelt2
http://markmail.org/thread/mderz4fopcsahp3n
Note that there are 2 threads because there was an unfortunate cross-post...

I think since Sergiu's change to defer javascript loading, the main cost is in the request/response cycle itself and there are a great number of inefficiencies to be dealt with in the request/response cycle so should this be closed as wontfix because it is too broad?

CalebJamesDeLisle
added a comment - 07/Oct/10 12:53 I think since Sergiu's change to defer javascript loading, the main cost is in the request/response cycle itself and there are a great number of inefficiencies to be dealt with in the request/response cycle so should this be closed as wontfix because it is too broad?

-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- Done: *sx pulls.

GZip all HTTP response contents TODO, right now it's done in the httpd frontend, not very important

Modify the build to automatically merge all CSS and JS files together in a single file Conflicts with #1; partially done since Colibri and Toucan have mostly one skin file instead of several, as Albatross does

Add expire headers TODO, important

-Minify CSS and JS files- Done, at build time for static resources and at runtime for wiki extensions

Sergiu Dumitriu
added a comment - 07/Oct/10 23:01
- 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 - Done: *sx pulls.
GZip all HTTP response contents TODO, right now it's done in the httpd frontend, not very important
Modify the build to automatically merge all CSS and JS files together in a single file Conflicts with #1; partially done since Colibri and Toucan have mostly one skin file instead of several, as Albatross does
Add expire headers TODO, important
- Minify CSS and JS files - Done, at build time for static resources and at runtime for wiki extensions

intertesto
added a comment - 06/Jul/11 12:30 - edited Just a note to signal my like in this feature. Another improvement is to use CSS sprite in order to reduce the number of images download, http://www.alistapart.com/articles/sprites and http://developer.yahoo.com/performance/rules.html

Thanks for the link, this could indeed be done by default in the standalone distribution. Note that Jetty evolved along XWiki, so those settings were not available for most of the time that we've been using it.

Sergiu Dumitriu
added a comment - 13/Mar/13 23:44 Thanks for the link, this could indeed be done by default in the standalone distribution. Note that Jetty evolved along XWiki, so those settings were not available for most of the time that we've been using it.

Vincent Massol
added a comment - 17/Jan/14 08:54 Note that reducing # of JS/CSS files can have negative effects too, see http://raibledesigns.com/rd/entry/you_shouldn_t_have_to
To summarize:
Use of HTTP 2.0 solve some issues
Concatenating may cost in having to reload the whole big file when a small change is made
Concatenating prevent the browser from executing js before the full big file is loaded
Something to take into account when we tackle this topic of page loading times.

Vincent Massol
added a comment - 11/Sep/15 13:25 Note that with HTTP/2 it'll be a good practice to have lots of small requests and combining together lots of resources together will become an anti pattern