News for hackers. Stuff that matters.
Re:CPP: A Standardized Alternative to AMP by woogley on Tuesday October 25, 2016 @10:27AM (#12788258)
Currently, SRI is not enough for browsers to implement content-addressable storage as you describe here, because it is subject to cache poisoning. See https://news.ycombinator.com/item?id=10311020 - basically, the browser can't know if a script can actually be loaded from the claimed domain without requesting it. This can be used to violate CSP.

Though it would be nice for the browser to cache it for domains that have delivered the script previously. It wouldn't be that different from a normal cache except the timestamp doesn't matter.

Re:CPP: A Standardized Alternative to AMP by sanbor on Tuesday October 25, 2016 @10:51AM (#12788472)
Thank you for the info! I imagined that there must be some technical issue as having hashes for content would make caching so easy. Anyway, at least using that hash for the same domain would save some requests, as browsers do requests to the server to see if the file hash matches in order to prevent sending the whole thing again.