Compression of JavaScript programs(bitsnbites.eu)
bitsnbites.eu
Compression of JavaScript programs
http://www.bitsnbites.eu/?p=20
3 comments
cough your server could serve gzipped stream and the browser would transparently uncompress it.
Sure there are browsers that can't decompress these streams, but your webserver already knows when to send the full (but minified) JS instead. Its all handled automatically.
Sure there are browsers that can't decompress these streams, but your webserver already knows when to send the full (but minified) JS instead. Its all handled automatically.
He mentions "small source size" competitions as one of the reasons for doing this and they all count the size of the raw js file, not the size of the gzipped file as sent by the server.
"Minifying" will still produce generally lower bandwidth use with automatic stream compression, and you get a significant benefit even for users who have broken browsers (or are stuck behind broken proxies) that don't support stream compression.
This is a great process to maximize your JS compression. However, it's important to keep in mind the application. From the jQuery dl page (yes, they use a different compression method):
"The packed versions require non-trivial client-side processing time to uncompress (unpack) the code whereas the minified versions do not."
"The packed versions require non-trivial client-side processing time to uncompress (unpack) the code whereas the minified versions do not."
----
[1] http://timepedia.blogspot.com/2009/08/on-reducing-size-of-co...
[2] http://code.google.com/p/google-web-toolkit/source/detail?r=...