1 April 2022

Public CDN's aren't useful anymore

Backdrop image
In case you missed it...
CDN's like googleapis.com won't make your site faster anymore since 2019.
Rico Sta. Cruz @rstacruz

Public CDN’s were supposed to help page speed, but things have changed in 2019. Services like Google Fonts, Cloudflare’s cdnjs, jsDelivr and Google Hosted Libraries may not help make sites load faster as much as it used to.

Shared caches don’t work anymore

Today, the primary advantage of public CDN’s is no longer supported by modern browsers.

Resources (like .js files) loaded by a site the user visits will no longer be cached for other sites they visit. Browsers have stopped having shared caches around Sep 2019 (Chrome 77, Firefox). This has all been done to address a cross-site leak security issue reported on March 2019:

About public CDN’s

CDN’s were supposed to help sites load faster. For example, a popular library like jQuery can be loaded from a CDN by one site, making it load faster for other sites the user will visit who would use the same CDN.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
☝Google has been running a CDN serving popular JavaScript libraries. (via Google Developers)

Other issues with public CDN’s

Are public CDN’s still useful?

While public CDN’s have been heavily nerfed, some have found it to be useful for other reasons.

What do we do now?

Thanks for reading! I'm Rico Sta Cruz, I write about web development and more. Subscribe to my newsletter!