Hacker News new | ask | show | jobs
by gbelote 5045 days ago
Performance is more dominated by latency than file size, and folks usually care about this more for page load time of a page than bandwidth cost. CDNs are usually better than hosting on your server directly, because they have better latency properties (many CDN endpoints which are more likely to be "closer" to the end user).

The advantage of sharing a CDN (as opposed to every site having it's own) is caching. If I visit website-a.com and they include jquery.js from cdnjs.com then I visit website-b.com that also uses the same file, I don't have to download it twice and website-b.com loads faster than if it served that file itself. That's the big win, IMO, but unfortunately depends on cdnjs having a high density of use. Even still, if you can shave a 100ms of the loading of your page that can matter.