3 ms·
> 2) Stop minifying scripts Controversial? Maybe, but why are we intentionally creating human unreadable gibberish for a modest gain when intermediate gzip com
by laumars 12y ago
> 2) Stop minifying scripts
Controversial? Maybe, but why are we intentionally creating human unreadable gibberish for a modest gain when intermediate gzip compression leads to much greater gains
gzip compression is already widely supported, however minification does sill have savings (eg removing comments from code - which really have no purpose being transmitted in the first place.
What is actually counter productive for compression is renaming all of your Javascript variable names to single character tokens. But that isn't something I've seen any Javascript minimizers do.
I'd also challenge your point about "human unreadable gibberish" as once the data leaves the server it doesn't need to be human readable. It only needs to be human readable at the development end - which is why minification only happens on live content hosted on the production environment.
- EvanPlaice 12y agoWhat I was implying was, minification only adds - at best - an additional %20 reduction in file size after gzip (ie which is more like 40%-60% reduction). Assuming practices #1 and #3 are followed, scripts should remain relatively small and the added benefit of minification would be negligible. Unless the end goal is obfuscation, I don't see the value of adding additional complexity to the development process for what amounts to a micro-optimization. Plus - from a user perspective - if a site's scripting fails, I'd like to see developers maintain the ability to view the source in production and determine why. In an unrelated note, I'd also like to see ES/CSS updated with new features that render the most common transpiled languages obsolete. I think transpiling is an awesome approach for testing language improvements and possibly building DSLs but supporting them in the long-term (ex tooling, backward compatibility) doesn't make sense. Speaking from the perspective of a library author/contributor. Developing, testing, and stabilizing a widely-used codebase over the long term is hard. Removing additional steps and reducing complexity makes life a bit easier.
- laumars 12y ago20% isn't worthless if you're browsing on a mobile phone on a slow GPRS connection. From an end user perspective, I get sick of all the responsive sites that look pretty on all screen sizes, but loads like a sack of shit on anything slower than WiFi. Which is why the libraries I write auto-minimize live code (they also use smaller dependencies, but that can be mitigated by your public CDN point).