In accordance with RFC 2616 , section 13.3.4, an HTTP 1.1 client MUST use an ETag in any cache-related requests, and if both ETag and Last Modified MUST use both. An ETag header is considered a strong validator (see Section 13.3.3) unless explicitly indicated by a weak server, while a Last Modified header is considered weak if there is not even a minute difference between it and the date header. Note, however, that the server is not required to send (but it MUST, if possible).
Please note that the Client does not check the headers to see if they have changed; he just blindly uses them in the next conditional query; the server must evaluate whether to send the requested content or a 304 Not Notified response. If the server sends only one, then the Client will use it alone (although only strong validators are useful for requesting a range). Of course, it is also at the discretion of the intermediate caches (unless they were protected from caching using Cache Control directives) and the server as to how they will affect headers; The RFC states that they SHOULD NOT return 304 Not Modified if the validators are inconsistent, but since the header values ββare generated by the server, it has quite a bit of freedom.
In practice, I noticed that Chrome, FireFox, and IE 7+ send both headers, if available. I also tested the behavior of sending modified headers, which I already suspected of information in the RFC. The four clients I tested sent only conditional requests if the pages were refreshed or this was the first time the page was requested by the current process.
Thomas S. Trias Oct 13 '09 at 13:01 2009-10-13 13:01
source share