4 ms·
I think the main reason that it's a best practice for people to minify their JavaScript files is for a smaller download size for the client. With a smaller dow
by ryanolsonx 11y ago
I think the main reason that it's a best practice for people to minify their JavaScript files is for a smaller download size for the client. With a smaller download size, the page is able to utilize JavaScript at an earlier point and be ready for the user to interact with the page. Minifying and gzipping JavaScript yields a greatly smaller file size than without either. Big win for performance.
- DanBC 11y agoJust checking: are you saying that minifying and gzipping is better than gzipping alone? Where better means smaller downloads for the client?
- blacksmith_tb 11y agoI read that to mean that gzip / deflate was nearly as effective, and so there was not much reason to minify if you were already compressing.
- noamyoungerm 11y agoWhile it is true that in practice, the size benefit of both compressing and minifying is optimal, the LZ77 algorithm is nearly the same as a minification algorithm, so running both has only marginal benefit.