Compressing Spry's JavaScript Files Part 2

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.

YUI Compressor

Related Blog Entries

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
Mike's Gravatar Have you tried to do the minification on the fly? Looks like it is setup for php. http://code.google.com/p/jsmin-php/
# Posted By Mike | 8/14/07 2:48 PM
Eric Hynds's Gravatar as a side note, compressed .js files are unpacked before the web page loads, from what I understand. There's the argument that packing a JS is useless because of the time it takes a browser to unpack it, but this is transparent to the user.
# Posted By Eric Hynds | 8/14/07 6:22 PM
BlogCFC was created by Raymond Camden. This blog is running version 5.8.001.