A slightly closer look at JSMin
A month or three ago I did a post on different JS compression utilities. At that time I had decided that the YUI compressor was the best.
“In my opinion YUI is the best, you can choose several different compression levels and it works very well compressing prototype, so well in fact that we got it to shrink down an extra 10k than what had been done with ShrinkSafe. Also the YUICompressor is semi-intelligent with whitespace, it checks for ascii characters before and after a piece of whitespace to know if it should remove it.”
After learning a bit more, I haven’t completely changed my mind, but I thought that I would mention JSMin a bit more. The main reason for this second look is that when combined with gzip (or deflate), JSMin really is a wonderful solution to compressing your javascript files (and the solution recommended by the jQuery team).
Speaking of jQuery, you can use JSMin to shrink the jquery.js down from 95k to 53k. Then you can use gzip on your server and it will crunch down to about 15k! I haven’t tried using gzip on a yui compressed file, but it may have the same problems that a PACKED js file has. Meaning gzip either won’t work on it, or your functions will “esplode”.
You can grab JSMin here (at the time of this post, the link to download the file is at the bottom of the page).
Add A Comment