[ka-Map-users] compressed javascript update

Paul Spencer pspencer at dmsolutions.ca
Thu Mar 23 08:06:48 EST 2006


Chris,

I've just checked this case too:

all js files combined, no white-space/comment removal but with gzip:  
39.7 kb
all js files combined, with white-space/comment removal and gzip:  
20.7 kb

You can try it by adding compress=no to the getcjs.php call.

Am I missing something?

Cheers

Paul

On 21-Mar-06, at 7:49 PM, Chris Tweedie wrote:

> Paul, in my experience GZIP on javascript files more than compensates
> for any high-level comment and whitespace removal. Perhaps you're  
> making
> it more cumbersome using getcjs+GZIP when GZIP itself may be more than
> adequate?
>
> I did something similar last year at
> http://chris.narx.net/2005/09/07/time-to-tweak-your-javascript-bloat/
> which was done on the first kamap release and the arcims4 html client.
>
> Chris
>
> -----Original Message-----
> From: ka-map-users-bounces at lists.maptools.org
> [mailto:ka-map-users-bounces at lists.maptools.org] On Behalf Of Paul
> Spencer
> Sent: Wednesday, 22 March 2006 3:11 AM
> To: ka-map-users at lists.maptools.org
> Subject: [ka-Map-users] compressed javascript update
>
> All,
>
> I've gone through all the code to get it to work with getcjs.php
> again.  I've also modified getcjs.php to handle compressing multiple
> files into a single file and to use ob_gzhandler (gzip compression).
> AFAIK, gzip compression is seamless and negotiates with the browser
> to determine if the browser supports it or not.
>
> Compression strips white space and comments (but its not very
> intelligent, so it can be fooled).  Combining gzip compression with
> white space removal and comment stripping has resulted in a reduction
> of the size of the javascript from
>
> kaKeymap.js : 13.1 kb
> kaLegend.js : 20.1 kb
> kaMap.js : 75.9 kb
> kaQuery.js : 9.1 kb
> kaTool.js : 14.2 kb
> scalebar.js : 23.1 kb
> startUp.js : 15.1 kb
>
> total: 170.5 kb
>
> to a compressed value of: 20.7 kb
>
> To enable this in your application, follow the comments at the top of
> index.html in the cvs version.
>
> Cheers
>
> Paul
>
> +-----------------------------------------------------------------+
> |Paul Spencer                           pspencer at dmsolutions.ca   |
> +-----------------------------------------------------------------+
> |Applications & Software Development                              |
> |DM Solutions Group Inc                 http://www.dmsolutions.ca/|
> +-----------------------------------------------------------------+
>
>
>
>
> _______________________________________________
> ka-Map-users mailing list
> ka-Map-users at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/ka-map-users
>
> This e-mail and any files transmitted with it are intended only for  
> the use of the addressee(s).  It may contain information that is  
> confidential and privileged.  If you are not an intended recipient,  
> any use, interference with, disclosure, distribution or copying of  
> this material is unauthorised and prohibited.  If you receive this  
> in error, please notify the author by Return email to the sender.   
> Information in this message not relating to the official business  
> of DLI shall be understood as neither given nor endorsed by it.   
> While every care is taken, it is recommended that you scan any  
> attachments for viruses.  DLI liability is limited to re-supplying  
> affected attachments.
>
> **********************
>
> PLEASE NOTE: All dola.wa.gov.au and vgo.wa.gov.au email addresses  
> will soon be decommissioned. These have been replaced by  
> dli.wa.gov.au addresses. Please ensure that your records are  
> updated to reflect this change.  Further information can be  
> obtained by contacting our service desk on 92737533 or emailing  
> Servicedesk at dli.wa.gov.au
>
> **********************
>
>

+-----------------------------------------------------------------+
|Paul Spencer                           pspencer at dmsolutions.ca   |
+-----------------------------------------------------------------+
|Applications & Software Development                              |
|DM Solutions Group Inc                 http://www.dmsolutions.ca/|
+-----------------------------------------------------------------+






More information about the ka-Map-users mailing list