I
don't say that dojo compression is not good, but try debugging in compressed
mode on production where your code is deployed, it's just
impossible.
Then
go through the pain of maintaining a development version of the file and a
production version of the file!
It's
really not worth complicating it that much unless ofcourse you already have a
system setup for this.
Otherwise, gzip is fine - and I don't know what theoretical evidence you
are talking about. Text gets compressed a lot (gzip looks for similarities) -
for example, if you had a file with 1000 @hotmail.com addresses it would
get compressed to something like 1KB :) but if all addresses were different
(just not possible in real world) then the compression wouldn't give great
results :)
With
that said, having a compressor that just removes multiple whitespaces / newlines
/ comments is good enough.
Thanks,
Mandy.
-----Original Message-----I would disagree with point #2 below. It has been researched(and theoretically proven? don't remember the details anymore..google search would probably turn it up) already that gzip ~may~ not always be as fast for deployment as people seem to think.
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Jesse Kuhnert
Sent: Monday, June 26, 2006 11:03 AM
To: rails-spinoffs@lists.rubyonrails.org
Subject: Re: [Rails-spinoffs] _javascript_ Compression
As for tool reliability, not sure I understand that one either. Rhino is fairly stable at this point and maintained by mozilla itself. The dojo compression code section isn't part of rhino, but small enough that any issues that come up are pretty easily resolvable. The _1_2 style name changes are the reason why the code is "compressed" to begin with...
It's not that much different from what the spidermonkey js bytecode interpreter does at runtime in your browser already.
On 6/26/06, Maninder, Singh <[EMAIL PROTECTED]> wrote: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-----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.
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
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
--
Jesse Kuhnert
Tacos/Tapestry, team member/developer
Open source based consulting work centered around dojo/tapestry/tacos/hivemind.
_______________________________________________ Rails-spinoffs mailing list Rails-spinoffs@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs