Since not everyone knows about my blog, I wanted to be sure that this 
news got out to as many folks as possible.

Last month I set out to see how far I could compress the CF8 JavaScript 
files. As many have come to find out, the YUI, Ext and Spry JS files can 
be rather large and I wanted to bring them down as much as possible.

As I was reading Ajaxian today, I saw a post about a new compressor 
called YUI Compressor which is a Java-based application which helps to 
greatly minify your JavaScript code. In speaking to my friend Tane 
Piper, he told me that he saw *amazing* results when he used it against 
his jQuery plugins. So I had to give this a shot against the CF8 files.

I immediately tried it against Spry's largest file, SpyData.js, and here 
were my results:

SpryData.js uncompressed: 126k
SpryData.js minified: 66k

Woah! Almost a 50% reduction in size.

I then tried it against the Dojo ShrinkSafe version of SpyData.js that I 
had created last month:

SpryData.js compressed with ShrinkSafe: 72k
SpryData.js minified: 64k

Wow, even more reduction if I run through the file through ShrinkSafe first!

I did try this on the Ext-All.js file and also saw a reduction of 30k in 
an already compressed file!

This is really a good utility to have and the results are outstanding. I 
would say to use this in conjunction with another packer and some http 
compression for really boosting performance on your web apps.

*** NOTE: If you're going to use this, please be sure to backup your 
existing CF8 JavaScript files just in case something doesn't work as 
expected.

Here are my two blog postings about this subject:

http://www.reybango.com/index.cfm/2007/7/22/Compressing-Sprys-JavaScript-Files
http://www.reybango.com/index.cfm/2007/8/14/Compressing-Sprys-JavaScript-Files-Part-2

YUI Compressor:
http://www.julienlecomte.net/blog/2007/08/13/introducing-the-yui-compressor/

Dojo ShrinkSafe:
http://alex.dojotoolkit.org/shrinksafe/


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade to ColdFusion 8 and integrate with Adobe Flex
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:286158
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to