3 ms·
> If the major consumers of the highest used frameworks all used the same CDN for delivery and smaller websites that want to use those same framework followed s
by WatchDog 5y ago
> If the major consumers of the highest used frameworks all used the same CDN for delivery and smaller websites that want to use those same framework followed suit this would greatly reduce wasted traffic across the web and make everyone faster.
Except that browsers no longer cache across origins anymore, so this doesn't work, also there are just a huge number of libraries and versions, so even if they did cache it, it's unlikely to result in much benefit.
- XCSme 5y agoI wanted to write the same comment, the premise of the article is wrong: "if all websites link to the same resources, that resource will not be downloaded multiple times across domains".
- noahtallen 5y agoThe other problem is that JS bundlers will (attempt to) strip out unused code to reduce the final bundle size. Not possible if the library isn’t part of the build
- spacebear 5y agoAlso, that massively centralizes the Internet in a way that's not great. If one of those CDNs gets hacked or just goes down for an hour, it breaks every website that uses it.
- dagw 5y agoIt's pretty easy and should be best practice to add a bit of code that checks if you successfully downloaded the library from the CDN and falls back to grabbing it from your server if it failed.
- brundolf 5y agoAnd many sites now use their own CDN anyway. Maybe the move away from centralized CDNs is wasteful in the aggregate, but it's not responsible for any perceived reduction in site performance.