4 ms·
It's a cool idea, even if just for performance reasons. So many things come from CDNs these days, we may as well start shopping the common ones ahead of time.
by viraptor 6y ago
It's a cool idea, even if just for performance reasons. So many things come from CDNs these days, we may as well start shopping the common ones ahead of time.
But recently I learned something unexpected. Lots of extensions are terrible with their resources. On a page targeting tech-savvy people, around 1% of requests has some extension content injected into the website which requests an external font file. (info comes from CSP reports) There's so much tracking opportunity exposed through them.
- toastal 6y agoIn recent years libraries haven't been used off CDN like this much but rather bundled, tree-shaken, and uploaded to a CDN with the library baked into a JavaScript app.
- deleted 6y ago[deleted]
- DavideNL 6y ago> "even if just for performance reasons" I don't think it matters for performance because it's cached in the browser anyway... So the purpose of the extension is privacy.
- gitgud 6y agoI may be wrong, but I don't think the browser caches CDN requests, at least per site... So this might be a performance gain too https://stackoverflow.com/questions/29704811/why-isnt-the-browser-loading-cdn-file-from-cache https://stackoverflow.com/questions/29704811/why-isnt-the-br...
- minitech 6y agoThe answer at that Stack Overflow question is seriously incomplete (and even it doesn’t say there’s no cache). Browsers today will, for the most part, cache CDN responses, not need to revalidate them, and share that cache across sites (though I think first-party isolation changes that to a per-site cache).
- gitgud 6y agoYeah that's what I meant, I'm pretty sure it's isolated by each domain for privacy reasons. * example.com -> GET cdnjs.com/jquery * another.com -> GET cdnjs.com/jquery (not cached from example.com) No caching of the CDN assets between sites within the browser, regardless of HTTP caching headers.
- m463 6y agoStop. Go and look at the stack overflow. Then view source and look at the CDN links stack overflow uses.
- minitech 6y agoIs your comment intended to be rude? Maybe more importantly: is intended to have a point?
- m463 6y agoI think most CDNs nowadays do not cache as much as you think because they are used for tracking.