4 ms·
Why? Why minify everything? It all gets gzipped at the HTTP layer anyway! I truly cannot understand this need to minify everything (JS included)
by orisho 7y ago
Why? Why minify everything? It all gets gzipped at the HTTP layer anyway! I truly cannot understand this need to minify everything (JS included)
- beckler 7y agoIt doesn't always get gzipped. That is highly dependent on the server. Minification usually reduces code size, and some minifiers will also implement various optimizations.
- s_m 7y agoDid you read the article? SVGs are super crufty and extremely easy to optimize.
- basilgohar 7y agoI started by downvoting your comment, and I realized I was choosing the cowardly way of reacting. I am saying this just to illustrate my own shallow reading of your comment at first and how I was avoiding actually being helpful. The short answer is that 99% of the time no purpose is being served by that cruft except to be bloat. Minifiers remove that cruft and optimize for the intended audience, which is machines. The longer answer is that in optimizing for machines, you're also optimizing for humans in the long run. Anyone stuck with a 2G connection, dial-up, or Bluetooth tethered device, or a new ultra low powered device on a different CPU architecture, will appreciate not having to operate solely in the world of gigabit+ connections, 8GB mobile devices, or 8 core hyperfast CPUs. Realize that such use cases still exist, and for very legitimate, not truly edge cases. Think of pages with hundreds or thousands of vector images. Not everyone can afford to run a Blink-powered browser or have CPU cycles for days. Every little bit helps. Edit to fix typo and add further clarity.
- bhousel 7y agoFun fact! SVG is one of those things that is often easy to minify down below your nginx/apache/cdn minimum gzip length. If your SVG files are < ~1kb, it's usually faster to just not gzip them. If they're < ~150b, gzipping will probably make both slower _and_ bigger.
- kukkukb 7y agoBecause when the browser un-gzips it, it takes a lot more memory than the minified version. And everyone seems to complain about browser bloat.