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.
-- 
Alessandro Pasotti
itOpen - "Open Solutions for the Net Age"
w3:  www.itopen.it
Linux User# 167502

-------------------------------------------------------------------------
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