Saturday, June 21, 2008

Easy speed up for Mapguide Fusion page load time

One thing i really did notice with a fresh mapguide install was not having javascript compressed by default.

Fusion especially uses a lot of javascript and it does take a while to load!

I have submitted a patch which enables compression of javascript which really does make the initial page load a lot faster.

You just need to add the following to the apache2/conf/mapguide.conf file, just before the RewriteEngine on line

AddType text/javascript js jgz
AddOutputFilterByType DEFLATE text/javascript

This will works for Apache both on linux and windows! You can do the same thing with IIS but it's not quite sooo simple


Anonymous said...

Have you tried calling fusion-compressed.js instead of fusion.js? This may further help performance by reducing the number of individual downloads required. I haven't tested myself though.

Zac Spitzer / Fastmovingtarget said...

No i haven't tried that yet. I had assumed it was being used out of the box...

gzipping still achieves a 82% compression on the combined file

the next big speedup is to reduce the initial 5-10s hang when it loads the map definition. Just using openlayers by itself is really really fast

Anonymous said...

IIS also has a setting to gzip both static and dynamic content. I believe its a server wide change though so not something mapguide should set.

One thing i have been meaning to propose would be to also process the JS/CSS with mapguide using YUI compressor. Legible code could still be distributed - for reading purposes. I think the YUI compressor will also maintain the API names..

Anonymous said...

look there, now i see the part where you said you could do it on IIS too hah. Long Long day.. =)

JasonBirch said...

I use a payware utility (think its called ZipEnable) by port 80 Software; it allows dir-level configuration in IIS.

You can edit the metabase manually to get the same results but its messy.

Apparently Fusion 1.1 will allow you to precompile your AppDef in with the fusion code; good for single-function sites. The xml-to-js translationis pricy.

Zac Spitzer / Fastmovingtarget said...

@Jason do you think this apache config should be committed into the Mapguide Tree?