I’m currently building up a PHP script that will answer HTTP “304 Not Modified” when required.
(See question #2086712 for what I do so far).
Currently I answer to the following:
- If-Modified-Since
- If-None-Match
But I found out that 3 more headers can trigger a “conditional GET” (See http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.3):
- If-Match
- If-Unmodified-Since
- If-Range
The last 2 seems irrevelent to my caching system (they seem to be used when resuming “big” downloads) but I haven’t found if “If-Match” could be of use in my system.
Does “If-Match” is used in proxies or Web browser for “regular” page content? How “If-Match” is different than “If-None-Match”?
Should I support those 3 or just some of them? Any help welcome!
If-Match
The server MUST return a 412 (Precondition Failed) response, if:
If-Match should be ignored, if:
Conclusion on if-match:
If-Match in RFC2616
If-Unmodified-Since
The server MUST return a 412 (Precondition Failed) response, if:
If-Unmodified-Since should be ignored, if
If-Unmodified-Since in RFC2616
If-Range
Preconditions:
If-Rangeheader SHOULD only be used together with aRangeheader, and MUST be ignored if the request does not include aRangeheader, or if the server does not support the sub-range operation.Server SHOULD provide 206 (Partial content) response, if
If-Rangeheader matches the current entity tag for the entity. Otherwise, server SHOULD return the entire entity using a 200 (OK) response.If-Range in RFC2616
Undefined results
Having the following combination of headers leads to an undefined result:
These rules have been decomposed from the following ones (can be found in RFC2616):
A more recent RFC 7232 superseded 2616.