4 ms·
There was probably a time when it did matter, but I believe (without much evidence) that the benefits of CDNs are less now. * Hosting on decently fast machines
by AndrewStephens 9y ago
There was probably a time when it did matter, but I believe (without much evidence) that the benefits of CDNs are less now.
* Hosting on decently fast machines is a lot cheaper.
* Overall bandwidth is increasing
* HTTP2 makes serving up resources cheaper and faster even without other changes. Before a page might request 100 resources and the browser would download them 8 at a time due to having a maximum number of connections to a server.
* Browsers are getting smarter about loading resources in general
* There used to be only a few big Javascript libraries that everyone tended to use (jQuery, etc). So your browser would download them once from the CDN and cache it for multiple sites. These days there are a lot more. Same with fonts. With hundreds of fonts available the chances of your page's fonts being in the cache is small.
The only resources that I think might still be worth offloading to a specialized third-party would be video files, which are still too large to be easily hosted.
- epicide 9y agoThis doesn't take the user's connection into account. The user could have a really slow connection (think 3G mobile or worse). Any amount of caching helps tremendously here. Also, caching and fat pipes are just two benefits of CDNs. They also handle the multi-region issue.
- AndrewStephens 9y ago> Also, caching and fat pipes are just two benefits of CDNs. They also handle the multi-region issue. If you are actually paying a CDN to host your stuff you can expect better service. Here we are talking about using resources from third-parties for "free".
- epicide 9y agoI don't see how that goes against what I said. Those three main benefits apply to anything hosted on CDNs.
- AndrewStephens 9y agoDon't get me wrong, CDNs are very useful for hosting high-traffic sites. And if you are paying them money to host all your resources then you are effectively in control as far as the issue we are talking about in this thread. My argument is that, for smaller sites, the received wisdom used to be that letting google (or whoever) host myspecalfont.wcf, or bigjavascriptlibrary.js, or whatever in their CDN was a good idea since it made your site load faster. This was certainly true, up to a point, but is less important now, due to the factors I listed. Whether or not these factors make a difference to you is completely dependent on the details of your site.
- dx034 9y agoLatency is still a factor. For any reasonably popular page with cloudflare in front of it, static files will be at the local edge. Requesting websites hosted in US-West from Europe is ~200ms latency, responses from the cloudflare edge here (London) usually have 20-30ms (TTFB). That can be a big difference, esp if you have spotty reception. If your users are all over the world this becomes even more important.
- dvfjsdhgfv 9y agoOK, but we're talking about hosting only a part of the website content on the CDN here. In this case - fonts. We can - and should - use the default font to render the text until the webfont has been completely loaded, using one of the available techniques. Unfortunately, even some high profile websites ignore this issue and block displaying the text until the font is loaded.