Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

He's implying that other sites may use the same popular Javascript libraries, so they may already be in the browser cache, before the first page load.


I've never understood why this was a good argument, because it just ignores that there are still going to be a lot of people who hit the worst-case scenario. When optimizing page-load time, you should always optimize for the worst-case scenario, not the best-case.


It really depends on your use-case & what you're doing. In many cases you will likely want to target ~ 95th percentile or similar.


Also, how likely is it that two websites use exactly the same CDN and version of e.g. jQuery or Angular?


This is probably a major contributing factor to the issue.

Personally, I've seen the greatest improvement in performance by avoiding latency more often than total download size. That's why concatenation works so well. It's just much more expensive to initiate two HTTP requests (four, if it does a HEAD first to get the Last Modified date), than one.

That said, I still limit total download size. JQuery is not a big enough contribution to my productivity to warrant an extra 86KB of data. React is like 132KB. Angular is 144KB. That's a lot of KB for anyone riding on the metro.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: