Currently in my application, I'm used to pack all external libraries and JS, CSS files. The tools I use strip all blank spaces and documentations unneeded.
So the files delivered to the client are nearly 50% lighter than the primary files, and I can still working (in debug mode) with documented and "human readable" files.
@qiang: Great! I was just thinking about this feature in Yii actually It would be a nice addition to CClientScript. Will it be one property for compression and one for packaging or one for both?
Minify: loose all comments, redundant white spaces etc.
Packer-Compressed (base62): The Minified JS code is compressed and it generates a new JS code, this is indeed smaller most of the times, but this is just playing dumb because with a gzip transfer, the Minified file will quite similar than the Compressed one, and won't have to be processed, because JS compression instead of GZIP compression means:
Load JS > Decompress file (using JS!) > Load new JS > Use
The time obviously depends on each CPU power, but the thing is simple, you save some KB in exchange for loading time.
So Minify and GZIP will give you almost the same size of a Packed (with the special feature JS-Compressed) file, but is much faster in terms of user response. Packer can be used without it, and will just minify the file.
If you’re concerned about the last few bits, it’s probably worth to shrink your images a bit more .
JSMin is considered safe, fast and available in a PHP version. YUI compressor is Java only (depends on Rhino engine).