News for hackers. Stuff that matters.

benmaurer

Re:Reload, reloaded: faster and leaner page reloads on Thursday January 26, 2017 @12:53PM (#13493509)
We discussed this approach -- one difficulty with it is that the website often doesn't know the hash of the resource. For example, imagine a server that takes urls of the from images.fbcdn.net/abc124.jpg/200x200 and dynamically resizes the image to 200x200 px. It it is impossible to know what the hash of this resource will be without calculating it beforehand.

The subresource integrity spec supports cases where the developer is able to calculate the hash beforehand

Re:Reload, reloaded: faster and leaner page reloads on Thursday January 26, 2017 @12:44PM (#13493425)
This use case will still work. If your connection is interrupted the resource will not be cached. The new reload behavior will still cause the resource to be re-requested.

What if the resource is corrupt -- say a bit got flipped due to a hardware error. In the old version of reload you would send a conditional request to the server "has this resource been modified since date X". The server would say "no it hasn't" with a 304 (unless the bit flip happened to affect the header and changed the date to a much newer date). Thus a normal reload would cause you to continue to use the invalid resource. The only way to fix this situation is by doing a ctrl+shift+r -- neither Chrome's nor Firefox's approach makes this worse than it was in the past