[Mapbender-dev] JavaScript compression

Christoph Baudson (WhereGroup) christoph.baudson at wheregroup.com
Thu May 24 05:52:35 EDT 2007


To enable Mapbender to load faster, the new release will employ 
JavaScript compression.

There has been a lot of discussion about this in the past; I think 
packing the JS files with JSMin is the best idea:

http://www.crockford.com/javascript/jsmin.html

+ the existing JS code must not stick to a given syntax
+ transparent (removes only linefeeds, whitespaces and comments)
+ no obfuscation
0 compared to real packers with still a good compression rate.

Files that are already compressed with other packers (like jQuery) will 
of course not be re-compressed.

Some more questions arise:

1) Where to store the compressed/uncompressed files in the file system. 
The default setting should be "compressed" IMHO. It should be easy to 
switch back and forth from uncompressed to compressed.

2) Which settings? Take a look at

http://fmarcia.info/jsmin/test.html

You can add comments. The compressed JS files will not have a license 
on top of the script, as comments are removed. Do we have to add a license?

For compression settings, I chose "conservative" for my test run; Some 
scripts like jsTree.js don't use the ; to end statements, so a linefeed 
mustn't be removed.

Any ideas?

Christoph


More information about the Mapbender_dev mailing list