Hi,

I saw many interesting things concerning compression to improve p.mapper
speed...

1) the JS compression algorithm :
http://www.julienlecomte.net/blog/2007/08/21/gzip-your-minified-javascript-files/
The author explain that if you use Apache compression (gzip /
mod_deflate), the smallest JS file isn't the smallest gzipped JS file.
So it seems to be very important to chose the good JS compression algorithm.

2) jQuery FAQ concerning compression :
http://docs.jquery.com/Frequently_Asked_Questions#How_do_I_compress_my_code.3F

3) License, author, etc... :
What about the lack of license in the distributed files ? I mean all the
comments are often deleted in the JS files after compression.
I saw in the last commit of Armin witch permit to add some pre-defined
licences.

4) use PHP to compress JS and CSS files :

4a) JS
http://perishablepress.com/press/2007/04/24/compressed-javascript-compression/
http://perishablepress.com/press/2007/03/26/fast-effective-php-compression/
The problem of number of files is not solve..

4b) CSS too...
http://perishablepress.com/press/2006/10/23/compressed-css-compression/
http://www.vaseltior.com/?p=24 in French, but I can make a short
translation in "bad English" if needed. 2 different methods, with one
witch doesn't need to modify the css files.
http://extjs.com/forum/showthread.php?t=1257

As far as I'm concerned, I don't know what to do. Moreover, there is the
problem of the pmapper core JS files, but also the plugins...

Thomas

Alessandro Pasotti a écrit :
> Hi,
>
> I would like to share some thought about p.mapper loading times, I feel
that having many uncompressed js files push up loading times significantly
due to two main reasons:
>
> 1 - file size (188KB uncompressed)
> 2 - number of requests
>
> Point 2 is browser dependant but AFAIK most browsers typically can
handle no more than 2 (IE) http requests simultaneously.
>
> I've come up with a solution that I'm using in many projects (mainly
ajax) and tests in pmapper give good results.
>
> This is what I've done:
>
> # cd javascript
> # for i in $(ls *.js); do mv $i $i.src; done # for i in $(ls *.js.src);
do jsjavacompress.sh $i >> pm.js ; done
>
>
> This produces a single 95KB pm.js file that is loaded at startup.
> additionally gzip gives a 27KB file.
>
> So we can go from 20 files 188KB to one file 27KB compressed and gzipped.
>
> # cat jsjavacompress.sh
> java -jar custom_rhino.jar -c $1 2>&1
>
> You can download custom_rhino.jar from here:
>
http://trac.dojotoolkit.org/browser/trunk/buildscripts/lib/custom_rhino.jar?rev=5877&format=raw
>
> There are many other js compression techniques, but I prefer this one as
it is less error prone.
>
> The same could be done in jquery directory.
>   





-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
pmapper-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pmapper-users

Reply via email to