3 ms·
You only save bandwidth the first time the resource is accessed. After that it's loaded from the browser cache! So over time, the band-witch saving by minificat
by z3t4 11y ago
You only save bandwidth the first time the resource is accessed. After that it's loaded from the browser cache! So over time, the band-witch saving by minification is insignificant.
- simoncion 11y agoSo, the answer to bojo's question is "Yes.". > After that it's loaded from the browser cache! Unless the resource changes, the UA's cache is cleared, the file is served with incorrect caching headers, the cache expiry time specified in the resource header is reached, the resource is loaded by a UA that doesn't cache...
- z3t4 11y agoLets say your .js files takes up 5% of your total app size after gzip compression, and minification saves you around 20%. Then you have saved around 1% bandwidth at the cost of obfuscation and more difficult debugging. And If it's cached, witch all main-steam browsers does, you've saved around 0.01% at best. So if you pay $10,000 in bandwidth costs each month, that's $1 saved :P
- simoncion 11y ago1) I can play the "let's make numbers up" game, too. 2) There are many, many people in the world today who access the internet through what is effectively a 2G connection. 3) "...at the cost of obfuscation and more difficult debugging." 3a) Sometimes obfuscation is a desirable side-effect. 3b) Javascript source maps exist for a reason. 4) "And If it's cached, witch all main-steam browsers does..." 4a) It's almost as if you ignored the majority of the last sentence in my previous comment. :)
- samspot 11y agoThe first time the resource is accessed is the most important. You have precious few seconds before the user instinctively reaches for the back button. See http://www.fastcompany.com/1825005/how-one-second-could-cost-amazon-16-billion-sales http://www.fastcompany.com/1825005/how-one-second-could-cost... and other similar articles.