You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(Sorry of this should be a PR - first time in this repo.)
Since reliance on CDNs for e.g. external Javascript files is bad, I recommend that all tags that have a 'src' attribute should also have an optional 'hash' attribute.
The author of the HTML file could then specify the e.g. SHA256 hash of the file required. The browser can then check if any file in it's cache matches that hash, and use a local copy, if available.
If there's a cache hit, this would save one HTTP request and would also allow the browser to use a file downloaded from some other URI, even with another filename, as long as the contents match.
This would, in turn, essentially resemble a distributed CDN for many often-used files, like the popular Javascript files and webfonts, etc.
The text was updated successfully, but these errors were encountered:
Hashes like this are already in use for Subresource Integrity (https://w3c.github.io/webappsec-subresource-integrity/), but in that context they don't replace the URL as the cache key, and the invalidation they provide happens separately from cache invalidation.
A problem with the idea of caching files by hash is that caches are partitioned per-site, and they're per-site for good reasons: script running on one site shouldn't be allowed to probe the cache for arbitrary files from another site, for the same reason that the :visited CSS style needs to be hidden from script.
It might still make sense for just certain files, selectively, to opt out from per-site caching? Those might even turn out to be the same files that #8143 is about.
(Sorry of this should be a PR - first time in this repo.)
Since reliance on CDNs for e.g. external Javascript files is bad, I recommend that all tags that have a 'src' attribute should also have an optional 'hash' attribute.
The author of the HTML file could then specify the e.g. SHA256 hash of the file required. The browser can then check if any file in it's cache matches that hash, and use a local copy, if available.
If there's a cache hit, this would save one HTTP request and would also allow the browser to use a file downloaded from some other URI, even with another filename, as long as the contents match.
This would, in turn, essentially resemble a distributed CDN for many often-used files, like the popular Javascript files and webfonts, etc.
The text was updated successfully, but these errors were encountered: