wouldn't it be nice if sites could share a cache of common js? ... stuff like react, or vue or svelte? 👉 there's an early stage proposal for cross-origin storage which enables exactly this. there are challenges but I think it's very interesting indeed
Post
We used to have this many years ago by default. It was common to load jQuery et al from a public CDN so most people wouldn't have to download it again just for your site. Then marketers started using it to fingerprint. And hackers used it to poison cross-origin JS. The feature got removed sigh
2 reposts37 likes
Right, but if you loaded the exact same jQuery from a different CDN, there was no cache hit. COS is hash-based, so now you can self host jQuery from swizecs-random-server dot com and still get a cache hit. The Public Hash List (github.com/WICG/cross-o...) proposal aims to mitigate the attacks.
The separate API is required for when you need flexibility: huggingface.co/blog/cross-o....
As an aside, we adopted SSRI for @calibreapp.com RUM and it’s a really great assurance to have as a script provider.
Yes, until ~7 years ago caches were *not* domain sharded for privacy. This used to work very well bsky.app/profile/swiz...
7 years, mate www.jefftk.com/p/shared-cac...
Safari’s partitioned it’s cache since 2013 andydavies.me/blog/2018/09... Shared caching benefits of JS CDNs has always be overstated IMV as there are just too many different versions in use. Explorations of the HTTP Archive data in 2018 backed this up