[Mapbender-dev] Optimization

Christoph Baudson (WhereGroup) christoph.baudson at wheregroup.com
Wed Dec 19 06:28:08 EST 2007

For the upcoming Mapbender 2.5 release I have been trying to optimize 
Mapbender's load process.

Here's what I did

* instead of loading each JS library itself, I have included them in 
map.php. These are for example jQuery, wz_graphics, jqjson, map_obj etc. 
The same applies to the modules of the GUI elements. These are also 
required in map.php, just like the javascripts.

* the JS files are now being loaded last. This had the effect that some 
functionality broke, as the GUI elements often need the register 
functions. So I extracted the event handling system from map.php and put 
it into core.php, which is still loaded in the HEAD of the document. So 
we are down to three JS files in index.php (not counting the embedded 

* the javascripts of the GUI elements are now loaded via require_once to 
avoid duplicate scripts in the GUI. Despite duplicate scripts slowing 
the client down, it also breaks functionality.

* at my own machine, I enabled Apache's output compression, which 
significantly reduces the file sizes. Here's how to achieve that: 

A helpful tool for optimization is Yahoo's YSlow, which Marc recommended 
some time ago, thanks again!  You can find it here: 

YSlow has a grading system, where 0 is worst an 100 is best. With the 
changes applied, Mapbender now ranks 68, compared to 46 before.

An enlightning presentation of YSlow can be downloaded here

(Yahoo also hosts some other great stuff in this section: 

If you have any comments or additional suggestions for optimization, 
please share your thoughts.


W h e r e G r o u p GmbH & Co. KG

Siemensstraße 8
53121 Bonn

Christoph Baudson

Fon: +49 (0)228 / 90 90 38 - 25
Fax: +49 (0)228 / 90 90 38 - 11
christoph.baudson at wheregroup.com
Amtsgericht Bonn, HRA 6788

WhereGroup Verwaltungs GmbH
vertreten durch:
Arnulf Christl, Olaf Knopp, Peter Stamm

More information about the Mapbender_dev mailing list