Connected: An Internet Encyclopedia
13.3.4 Rules for When to Use Entity Tags and Last-modified Dates
Up:
Connected: An Internet Encyclopedia
Up:
Requests For Comments
Up:
RFC 2068
Up:
13 Caching in HTTP
Up:
13.3 Validation Model
Prev: 13.3.3 Weak and Strong Validators
Next: 13.3.5 Non-validating Conditionals
13.3.4 Rules for When to Use Entity Tags and Last-modified Dates
13.3.4 Rules for When to Use Entity Tags and Last-modified Dates
We adopt a set of rules and recommendations for origin servers,
clients, and caches regarding when various validator types should be
used, and for what purposes.
HTTP/1.1 origin servers:
- SHOULD send an entity tag validator unless it is not feasible to
generate one.
- MAY send a weak entity tag instead of a strong entity tag, if
performance considerations support the use of weak entity tags, or
if it is unfeasible to send a strong entity tag.
- SHOULD send a Last-Modified value if it is feasible to send one,
unless the risk of a breakdown in semantic transparency that could
result from using this date in an If-Modified-Since header would
lead to serious problems.
In other words, the preferred behavior for an HTTP/1.1 origin server
is to send both a strong entity tag and a Last-Modified value.
In order to be legal, a strong entity tag MUST change whenever the
associated entity value changes in any way. A weak entity tag SHOULD
change whenever the associated entity changes in a semantically
significant way.
Note: in order to provide semantically transparent caching, an
origin server must avoid reusing a specific strong entity tag value
for two different entities, or reusing a specific weak entity tag
value for two semantically different entities. Cache entries may
persist for arbitrarily long periods, regardless of expiration
times, so it may be inappropriate to expect that a cache will never
again attempt to validate an entry using a validator that it
obtained at some point in the past.
HTTP/1.1 clients:
- If an entity tag has been provided by the origin server, MUST
use that entity tag in any cache-conditional request (using
If-Match or If-None-Match).
- If only a Last-Modified value has been provided by the origin
server, SHOULD use that value in non-subrange cache-conditional
requests (using If-Modified-Since).
- If only a Last-Modified value has been provided by an HTTP/1.0
origin server, MAY use that value in subrange cache-conditional
requests (using If-Unmodified-Since:). The user agent should
provide a way to disable this, in case of difficulty.
- If both an entity tag and a Last-Modified value have been
provided by the origin server, SHOULD use both validators in
cache-conditional requests. This allows both HTTP/1.0 and
HTTP/1.1 caches to respond appropriately.
An HTTP/1.1 cache, upon receiving a request, MUST use the most
restrictive validator when deciding whether the client's cache entry
matches the cache's own cache entry. This is only an issue when the
request contains both an entity tag and a last-modified-date
validator (If-Modified-Since or If-Unmodified-Since).
A note on rationale: The general principle behind these rules is
that HTTP/1.1 servers and clients should transmit as much non-
redundant information as is available in their responses and
requests. HTTP/1.1 systems receiving this information will make the
most conservative assumptions about the validators they receive.
HTTP/1.0 clients and caches will ignore entity tags. Generally,
last-modified values received or used by these systems will support
transparent and efficient caching, and so HTTP/1.1 origin servers
should provide Last-Modified values. In those rare cases where the
use of a Last-Modified value as a validator by an HTTP/1.0 system
could result in a serious problem, then HTTP/1.1 origin servers
should not provide one.
Next: 13.3.5 Non-validating Conditionals
Connected: An Internet Encyclopedia
13.3.4 Rules for When to Use Entity Tags and Last-modified Dates