4 ms·
You have smattering of disasters, that let you sort of fake it till you make it? :) For 1) You have SRI: https://developer.mozilla.org/en-US/docs/Web/Security
by zie 5y ago
You have smattering of disasters, that let you sort of fake it till you make it? :)
For 1)
You have SRI: https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity https://developer.mozilla.org/en-US/docs/Web/Security/Subres...
You have Etag
and you have Content-MD5: https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.15 https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec1...
Like you already mentioned etag sucks, because you just get a guarantee X hasn't changed but no way to now how it was calculated. i.e. it is opaque.
SRI is only useful for everything outside of the original document(i.e. for <script> tags and the like.
Content-MD5 actually works.. except it's using the broken MD5 digest.. so it might work for the use case, depending on the details of the use-case. :)
2 is a no-go as far as I'm aware.
Though you could perhaps do an HTML document where you link to each "chunk" of the file using SRI.. though that would be a total bastardization of HTML and a total hack.. and a bad one at that :) Also the chunks would be decided well ahead of time that way, so not the same as a RANGE..