3 ms·
Well, back when that was common you'd import a numbered version, like "https://cdn.example.com/js/library-v1.2.3.js https://cdn.example.com/js/library-v1.2.3.js
by michaelt 5y ago
Well, back when that was common you'd import a numbered version, like "https://cdn.example.com/js/library-v1.2.3.js https://cdn.example.com/js/library-v1.2.3.js" which, unless the CDN was evil, would be immutable.
Someone even came up with a standard for "subresource integrity" [1] where you could specify a checksum of the thing you were importing from a CDN, so it couldn't be replaced by an evil CDN. I don't believe it ever achieved widespread use.
[1] https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity https://developer.mozilla.org/en-US/docs/Web/Security/Subres...
- dexterdog 5y agoIt doesn't need widespread use since you get the benefit of using by just using it on your own site.