HTTP ETag: Difference between revisions

Content deleted Content added
Undid revision 979535974 by 2806:2F0:1020:3A8:44B8:93FC:2C7E:7673 (talk)
m Replaced an outdated html code with a wikicode.
Line 48:
 
=== Mismatched ETag detection ===
A buggy website can at times fail to update the ETag after its semantic resource has been updated. {{As of |2019}}, an example of a prominent such site is <tt>{{mono|export.arxiv.org</tt>}}.<ref>{{cite web |url=https://gist.github.com/impredicative/cb4c8cdec9bde5189dab0a8e36f35b9e |title=Mismatched export.arxiv.org ETag}}</ref> As a result, the incorrectly returned response is status 304, and the client fails to retrieve the updated resource. To detect such a buggy website:
* Cache the response and ETag, assuming there is an ETag and that the response was not aborted.
* For a subsequent request that would've included the If-None-Match header, do not send this header with perhaps a random 20% probability. With this probability, if the response returns an altered content but the same ETag as what was previously cached, mark the website as buggy and disable ETag caching for it. As a reminder, for a strong ETag, the content comparison can be byte-for-byte, whereas, for a weak ETag, it would check semantic equivalence only.