3 ms·
http://www.w3.org/TR/SRI/ http://www.w3.org/TR/SRI/ It's called "subresource integrity". Mozilla and Google have reps working on the spec. Example: <scri
by Animats 12y ago
http://www.w3.org/TR/SRI/ http://www.w3.org/TR/SRI/
It's called "subresource integrity". Mozilla and Google have reps working on the spec. Example:
<script
src="http://code.jquery.com/jquery-1.10.2.min.js"
integrity="ni:///sha-256;C6CB9UYIS9UJeqinPHWTHVqh_E1uhG5Twh-Y5qFQmYg?ct=application/javascript">
Anybody in the transmission path can cache that, but they can't change it. This improves caching performance in general, because you don't need timed expiration. Load JQuery-1.10.2 once, and never load it again unless it changes.
- richbradshaw 12y agoWell, they can change it if it and the resource are not served over HTTPS by changing both the hash and the response for the resource. This doesn't add much unless at least the parent page is using HTTPS, else the hash can simply be stripped anyway. If browsers had an HSTS type precache list for sites that must use hashes, if they aren't using HTTPS then the resource and the hash can be changed.