I'd like to add 2 things here -
 
(1) Dojo also provides an online tool for the same (for those of you who don't want to go through the hassle of setting up anything :)
It's called SHRINKSAFE: http://alex.dojotoolkit.org/shrinksafe/
 
(2) As far as gzip is concerned, that's what I would advise anyone trying for js compression (as none of the tools are reliable and debugging becomes a pain later on with the compressed code). Especially with dojo that even changes function names to something like _1 _2 and so on... But, gzip is not 100% reliable, yes it's not. There are known issues in some of the IE versions (for external js files) - the transfer stops abruptly sometimes (I think it happens on IE 6 without service pack) and the user would see a blank page or page with errors. It's not the case with just html gzip so if you are putting your scripts inline, then go for gzip, else do extensive testing if you support multiple platforms/os/browsers/etc.
 
Thank you,
Mandy.
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Siegfried Puchbauer
Sent: Monday, June 26, 2006 3:49 AM
To: rails-spinoffs@lists.rubyonrails.org
Subject: Re: [Rails-spinoffs] _javascript_ Compression

I use mod_deflate in my apache httpd to compress the js files. Nearly every modern browser supports contenttype gzip and you get a reduction from about 60 to 80% of the source files. One of the benefits is that you can compress any content (html, css, js ...)... Formerly i also tried js source compression, but i was not lucky about the results.

brgds

sigi

On 6/25/06, Sam <[EMAIL PROTECTED]> wrote:
> It is Java-based, so should run on windows without a problem. It isn't a
> polished GUI at the moment, you'll need to do a bit of scripting to get it

> set up.  More details here:

> http://dojotoolkit.org/docs/compressor_system.html

Here's a batch file I used to compress all my _javascript_s... It put the
compressed *.js files in a subfolder compress, and references the rhino.jar
on my drive D.

MD compress
FOR %%f IN (*.js) DO java -jar d:\rhino\custom_rhino.jar -c %%f >
compress/%%f 2>&1
Pause

I see about a 30% to 40% reduction in file size, and amazingly, everything
ran the first time.  Compressed prototype.js, script aculo, windows and
more...

I imagine the success of this compression engine is due to the hooks into
the Mozilla _javascript_ engine to get the parsing correct...

I'm happy to have found this tool.

Sam



_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Reply via email to