5 ms·
There are bunch of things you miss: 1. Gzip is not free. You would have to perform it on every single request. That costs money. Minification is a one time thi
by arihant 11y ago
There are bunch of things you miss:
1. Gzip is not free. You would have to perform it on every single request. That costs money. Minification is a one time thing.
2. Gzip does not strip documentation.
3. Gzip, as you mentioned, cannot do language specific compression. So if your code is written poorly and can be better written with a closure, Gzip won't do that for you. Proper minification will.
4. Gzipping minified code is cheaper than gzipping non minified code.
5. Minified code uses lesser breadth of variable names and literals. This makes for more efficient Gzip.
As others have mentioned - Gzipping gives around 50% compression, full minification around 70%, and both combined around 80-90%. So if you go whole nine yards, you can save 40% extra on bandwidth. That could equate to thousands of dollars in saving every month for even a moderately famous web app.
- justincormack 11y agoYou can pre-gzip, or cache the gzipped version; some servers do; in fact storing the gzipped version and occasionally uncompressing it for clients that cant do compression is much more efficient than the reverse as uncompressing is much faster.
- wang_li 11y agoYou can store both on disk, apache at least, will figure out if the client can handle gzipped content and will send the compressed version when possible.
- deleted 11y ago[deleted]
- icebraining 11y agoSame for nginx, using the gzip_static module: http://nginx.org/en/docs/http/ngx_http_gzip_static_module.html http://nginx.org/en/docs/http/ngx_http_gzip_static_module.ht...
- arihant 11y agoBut doing cache in this way sort of defeats the argument. Why would one cache a gzip copy instead of minified or minified+gipped? And minified alone is more efficient than gzip and can work regardless of client preference. The argument here is why not simply use gzip and not use minification at all.
- NoMoreNicksLeft 11y ago> Gzip is not free. You would have to perform it on every single request. That costs money. Minification is a one time thing. Do it once and cache.