[Logo] Serotonin Software Community
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
page load times and performance  XML
Forum Index » Development general discussion
Author Message
craig

Initiate

Joined: 06/08/2007 16:50:46
Messages: 144
Offline

I have the displeasure of maintaining a mango instance over a satellite link. The following has made the pages load much faster,from 30+ second page load times to 2.5s (once cache is primed). Fast links and servers may not notice much.

1. Enable gzip compression in tomcat:
in conf/server.xml


2. I rebuilt the dojo.js file to include every module that mango uses. This saves several round trips which take a long time with 800ms latency. While the file is bigger, it is now gzipped so actually is smaller. Here is the profile file which goes in buildscripts/profiles with the dojo source distribution available from http://build.dojotoolkit.org/0.4.3/



Then dojo 0.4 is built by


3. I've added an HttpResponseHeaderFilter which adds an Expires header so that static content may be cached. This is particularly useful because it saves a round trip for every icon and also allows the dojo.js file to be cached.


4. The DWR javascript files appear to be dynamically generated for every page load but are in fact static scripts, with the expcetion of engine.js, which is 99.9% static. Jawr (https://jawr.dev.java.net/integration/dwr.html) lets the dwr scripts be gzipped and cached and takes care of the dynamic portion of engine.js. DWR must be upgraded from 2.0.1 which ships with mango 1.7 to dwr 2.0.5. DWR 3 will take care of this without jawr but isn't released or ready. You will also have to download jawr and add it to WEB-INF/lib.

This message was edited 2 times. Last update was at 03/11/2009 23:04:37

mlohbihler

Master
[Avatar]

Joined: 01/03/2007 22:48:52
Messages: 1456
Offline

Brilliant stuff, Craig. Thanks for sharing.

Best regards,
Matthew Lohbihler
mlohbihler

Master
[Avatar]

Joined: 01/03/2007 22:48:52
Messages: 1456
Offline

Hey Craig,

Much of this has been ported into the next version of Mango. There doesn't seem to be a way to enable GZIP by web app, so that part will have to be the responsibility of the installer.

The dojo profile seems to have a dramatic effect on page load times, so thanks for that.

Regarding the headers, i folded the DWR stuff into this as well instead of going the jawr route. I'm pretty sure the 0.1% of engine.js that is dynamic is not used by Mango, so it is safe to cache the file. (Just for comet i think.) So far everything looks good (and faster!).

Here's the web.xml config i used:


Best regards,
Matthew Lohbihler
mlohbihler

Master
[Avatar]

Joined: 01/03/2007 22:48:52
Messages: 1456
Offline

Oh, i also added audio and graphics to cached directories.

Best regards,
Matthew Lohbihler
 
Forum Index » Development general discussion
Go to:   
Powered by JForum 2.1.9 © JForum Team