How to use the YUI compressor
Saturday, December 13, 2008
Compressing your javascript and CSS is a easy way to save bandwidth and make a site’s download and performance feel a bit snappier. There’s lots of tools to allow you to do this, but from my research it seems that Yahoo!‘s YUI compressor is the overall best. Sure there’s others out there like JSmin and Dean Edward’s packer, but YUI offers a higher compression ratio, it also works with CSS files, and it’ won’t obfuscate your code.
Compressors work by removing all comments and whitespace (line breaks), and in some cases they will actually analyze your code and shrink variable names. Using compression can result in up to a 60% decrease in file size! So lets get started in learning how to use the YUI compressor!
Read more...Filed under General, Web, Code, Javascript • 9 Comments • Permanent link