Re:Modern JavaScript has made the web worse (2020)
by spacebear on Sunday November 14, 2021 @07:14PM
(#29222052)
Also, 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.
Re:Modern JavaScript has made the web worse (2020)
by dagw on Monday November 15, 2021 @04:49AM
(#29225597)
It'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.
Re:Modern JavaScript has made the web worse (2020)
by noahtallen on Sunday November 14, 2021 @07:05PM
(#29222006)
The 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
Re:Modern JavaScript has made the web worse (2020)
by brundolf on Sunday November 14, 2021 @07:47PM
(#29222274)
And 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.
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.