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:
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):
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!
The meaning of "If-None-Match: *" is that the method MUST NOT be performed if the representation selected by the origin server (or by a cache, possibly using the Vary mechanism, see section 14.44) exists, and SHOULD be performed if the representation does not exist.
The If-Modified-Since header is used to specify the time at which the browser last received the requested resource. The If-None-Match header is used to specify the entity tag that the server issued with the requested resource when it was last received.
1 If-Match: W/"d14c91f83b4554b6" Select the correct answer: The server should NOT include PATCH instructions in the Response body if the resource is semantically equivalent to the version referenced by the "d14c91f83b4554b6" ETag.
The If-Match HTTP request header makes a request conditional. A server will only return requested resources for GET and HEAD methods, or upload resource for PUT and other non-safe methods, if the resource matches one of the listed ETag values.
The server MUST return a 412 (Precondition Failed) response, if:
If-Match should be ignored, if:
Conclusion on if-match:
If-Match in RFC2616
The server MUST return a 412 (Precondition Failed) response, if:
If-Unmodified-Since should be ignored, if
If-Unmodified-Since in RFC2616
Informally, its meaning is 'if the entity is unchanged, send me the part(s) that I am missing; otherwise, send me the entire new entity'
Preconditions:
If-Range
header SHOULD only be used together with a Range
header, and MUST be ignored if the request does not include a Range
header, or if the server does not support the sub-range operation.Server SHOULD provide 206 (Partial content) response, if If-Range
header matches the current entity tag for the entity. Otherwise, server SHOULD return the entire entity using a 200 (OK) response.
If-Range in RFC2616
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):
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With