Source: http://greenbytes.de/tech/webdav/draft-ietf-httpbis-p4-conditional-08.html
Timestamp: 2017-04-27 22:39:16
Document Index: 108022695

Matched Legal Cases: ['art 4', 'art 4', 'art 4', 'art 4', 'art6', 'art1', 'art1', 'art1', 'art1', 'art5', 'art1', 'art1', 'art5', 'art5', 'art6', 'art5', 'art6', 'art1', 'art1', 'art 1', 'art5', 'art 5', 'art6', 'art 6', 'art2', 'art1', 'art5', 'art6']

HTTP/1.1, part 4: Conditional RequestsHTTPbis Working GroupR. Fielding, EditorInternet-DraftDay SoftwareObsoletes: 2616 (if approved)J. GettysIntended status: Standards TrackOne Laptop per ChildExpires: April 29, 2010J. MogulHPH. FrystykMicrosoftL. MasinterAdobe SystemsP. LeachMicrosoftT. Berners-LeeW3C/MITY. Lafon, EditorW3CJ. Reschke, EditorgreenbytesOctober 26, 2009HTTP/1.1, part 4: Conditional Requestsdraft-ietf-httpbis-p4-conditional-08Status of this MemoThis Internet-Draft is submitted to IETF in full conformance with the provisions of BCP 78 and BCP 79. This document may contain material from IETF Documents or IETF Contributions published or made publicly available before November 10, 2008. The person(s) controlling the copyright in some of this material may not have granted the IETF Trust the right to allow modifications of such material outside the IETF Standards Process. Without obtaining an adequate license from the person(s) controlling the copyright in such materials, this document may not be modified outside the IETF Standards Process, and derivative works of it may not be created outside the IETF Standards Process, except to format it for publication as an RFC or to translate it into languages other than English.¶Internet-Drafts are working documents of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note that other groups may also distribute working documents as Internet-Drafts.¶Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as “work in progress”.¶The list of current Internet-Drafts can be accessed at http://www.ietf.org/ietf/1id-abstracts.txt.¶The list of Internet-Draft Shadow Directories can be accessed at http://www.ietf.org/shadow.html.¶This Internet-Draft will expire on April 29, 2010.¶Copyright NoticeCopyright © 2009 IETF Trust and the persons identified as the document authors. All rights reserved.¶This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents in effect on the date of publication of this document (http://trustee.ietf.org/license-info). Please review these documents carefully, as they describe your rights and restrictions with respect to this document.¶AbstractThe Hypertext Transfer Protocol (HTTP) is an application-level protocol for distributed, collaborative, hypermedia information systems. HTTP has been in use by the World Wide Web global information initiative since 1990. This document is Part 4 of the seven-part specification that defines the protocol referred to as "HTTP/1.1" and, taken together, obsoletes RFC 2616. Part 4 defines request header fields for indicating conditional requests and the rules for constructing responses to those requests.¶Editorial Note (To be removed by RFC Editor)Discussion of this draft should take place on the HTTPBIS working group mailing list (ietf-http-wg@w3.org). The current issues list is at <http://tools.ietf.org/wg/httpbis/trac/report/11> and related documents (including fancy diffs) can be found at <http://tools.ietf.org/wg/httpbis/>.¶The changes in this draft are summarized in Appendix C.9.¶Table of Contents1. Introduction1.1. Requirements1.2. Syntax Notation1.2.1. Core Rules1.2.2. ABNF Rules defined in other Parts of the Specification2. Entity Tags3. Status Code Definitions3.1. 304 Not Modified3.2. 412 Precondition Failed4. Weak and Strong Validators5. Rules for When to Use Entity Tags and Last-Modified Dates6. Header Field Definitions6.1. ETag6.2. If-Match6.3. If-Modified-Since6.4. If-None-Match6.5. If-Unmodified-Since6.6. Last-Modified7. IANA Considerations7.1. Status Code Registration7.2. Message Header Registration8. Security Considerations9. Acknowledgments10. References10.1. Normative References10.2. Informative ReferencesA. Compatibility with Previous VersionsA.1. Changes from RFC 2616B. Collected ABNFC. Change Log (to be removed by RFC Editor before publication)C.1. Since RFC2616C.2. Since draft-ietf-httpbis-p4-conditional-00C.3. Since draft-ietf-httpbis-p4-conditional-01C.4. Since draft-ietf-httpbis-p4-conditional-02C.5. Since draft-ietf-httpbis-p4-conditional-03C.6. Since draft-ietf-httpbis-p4-conditional-04C.7. Since draft-ietf-httpbis-p4-conditional-05C.8. Since draft-ietf-httpbis-p4-conditional-06C.9. Since draft-ietf-httpbis-p4-conditional-07IndexAuthors' Addresses1. IntroductionThis document defines HTTP/1.1 response metadata for indicating potential changes to payload content, including modification time stamps and opaque entity-tags, and the HTTP conditional request mechanisms that allow preconditions to be placed on a request method. Conditional GET requests allow for efficient cache updates. Other conditional request methods are used to protect against overwriting or misunderstanding the state of a resource that has been changed unbeknownst to the requesting client.¶This document is currently disorganized in order to minimize the changes between drafts and enable reviewers to see the smaller errata changes. The next draft will reorganize the sections to better reflect the content. In particular, the sections on resource metadata will be discussed first and then followed by each conditional request-header, concluding with a definition of precedence and the expectation of ordering strong validator checks before weak validator checks. It is likely that more content from [Part6] will migrate to this part, where appropriate. The current mess reflects how widely dispersed these topics and associated requirements had become in [RFC2616].¶1.1. RequirementsThe key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119].¶An implementation is not compliant if it fails to satisfy one or more of the MUST or REQUIRED level requirements for the protocols it implements. An implementation that satisfies all the MUST or REQUIRED level and all the SHOULD level requirements for its protocols is said to be "unconditionally compliant"; one that satisfies all the MUST level requirements but not all the SHOULD level requirements for its protocols is said to be "conditionally compliant."¶1.2. Syntax NotationThis specification uses the ABNF syntax defined in Section 1.2 of [Part1] (which extends the syntax defined in [RFC5234] with a list rule). Appendix B shows the collected ABNF, with the list rule expanded.¶The following core rules are included by reference, as defined in [RFC5234], Appendix B.1: ALPHA (letters), CR (carriage return), CRLF (CR LF), CTL (controls), DIGIT (decimal 0-9), DQUOTE (double quote), HEXDIG (hexadecimal 0-9/A-F/a-f), LF (line feed), OCTET (any 8-bit sequence of data), SP (space), VCHAR (any visible USASCII character), and WSP (whitespace).¶1.2.1. Core RulesThe core rules below are defined in Section 1.2.2 of [Part1]:¶  quoted-string = &lt;quoted-string, defined in [Part1], Section 1.2.2&gt;
1.2.2. ABNF Rules defined in other Parts of the SpecificationThe ABNF rules below are defined in other parts:¶  HTTP-date     = &lt;HTTP-date, defined in [Part1], Section 6.1&gt;
2. Entity TagsEntity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the ETag (Section 6.1), If-Match (Section 6.2), If-None-Match (Section 6.4), and If-Range (Section 5.3 of [Part5]) header fields. The definition of how they are used and compared as cache validators is in Section 4. An entity tag consists of an opaque quoted string, possibly prefixed by a weakness indicator.¶  entity-tag = [ weak ] opaque-tag
A "strong entity tag" MAY be shared by two entities of a resource only if they are equivalent by octet equality.¶A "weak entity tag," indicated by the "W/" prefix, MAY be shared by two entities of a resource only if the entities are equivalent and could be substituted for each other with no significant change in semantics. A weak entity tag can only be used for weak comparison.¶An entity tag MUST be unique across all versions of all entities associated with a particular resource. A given entity tag value MAY be used for entities obtained by requests on different URIs. The use of the same entity tag value in conjunction with entities obtained by requests on different URIs does not imply the equivalence of those entities.¶3. Status Code Definitions3.1. 304 Not ModifiedIf the client has performed a conditional GET request and access is allowed, but the document has not been modified, the server SHOULD respond with this status code. The 304 response MUST NOT contain a message-body, and thus is always terminated by the first empty line after the header fields.¶The response MUST include the following header fields: ¶Date, unless its omission is required by Section 9.3.1 of [Part1].If a clockless origin server obeys these rules, and proxies and clients add their own Date to any response received without one (as already specified by Section 9.3 of [Part1], caches will operate correctly.ETag and/or Content-Location, if the header would have been sent in a 200 response to the same request.Expires, Cache-Control, and/or Vary, if the field-value might differ from that sent in any previous response for the same variant.If the conditional GET used a strong cache validator (see Section 4), the response SHOULD NOT include other entity-headers. Otherwise (i.e., the conditional GET used a weak validator), the response MUST NOT include other entity-headers; this prevents inconsistencies between cached entity-bodies and updated headers.¶If a 304 response indicates an entity not currently cached, then the cache MUST disregard the response and repeat the request without the conditional.¶If a cache uses a received 304 response to update a cache entry, the cache MUST update the entry to reflect any new field values given in the response.¶3.2. 412 Precondition FailedThe precondition given in one or more of the request-header fields evaluated to false when it was tested on the server. This response code allows the client to place preconditions on the current resource metainformation (header field data) and thus prevent the requested method from being applied to a resource other than the one intended.¶4. Weak and Strong ValidatorsSince both origin servers and caches will compare two validators to decide if they represent the same or different entities, one normally would expect that if the entity (the entity-body or any entity-headers) changes in any way, then the associated validator would change as well. If this is true, then we call this validator a "strong validator."¶However, there might be cases when a server prefers to change the validator only on semantically significant changes, and not when insignificant aspects of the entity change. A validator that does not always change when the resource changes is a "weak validator."¶Entity tags are normally "strong validators," but the protocol provides a mechanism to tag an entity tag as "weak." One can think of a strong validator as one that changes whenever the bits of an entity changes, while a weak value changes whenever the meaning of an entity changes. Alternatively, one can think of a strong validator as part of an identifier for a specific entity, while a weak validator is part of an identifier for a set of semantically equivalent entities. ¶Note: One example of a strong validator is an integer that is incremented in stable storage every time an entity is changed.An entity's modification time, if represented with one-second resolution, could be a weak validator, since it is possible that the resource might be modified twice during a single second.Support for weak validators is optional. However, weak validators allow for more efficient caching of equivalent objects; for example, a hit counter on a site is probably good enough if it is updated every few days or weeks, and any value during that period is likely "good enough" to be equivalent.A "use" of a validator is either when a client generates a request and includes the validator in a validating header field, or when a server compares two validators.¶Strong validators are usable in any context. Weak validators are only usable in contexts that do not depend on exact equality of an entity. For example, either kind is usable for a conditional GET of a full entity. However, only a strong validator is usable for a sub-range retrieval, since otherwise the client might end up with an internally inconsistent entity.¶Clients MUST NOT use weak validators in range requests ([Part5]).¶The only function that HTTP/1.1 defines on validators is comparison. There are two validator comparison functions, depending on whether the comparison context allows the use of weak validators or not: ¶The strong comparison function: in order to be considered equal, both opaque-tags MUST be identical character-by-character, and both MUST NOT be weak.The weak comparison function: in order to be considered equal, both opaque-tags MUST be identical character-by-character, but either or both of them MAY be tagged as "weak" without affecting the result.The example below shows the results for a set of entity tag pairs, and both the weak and strong comparison function results:¶ETag 1ETag 2Strong ComparisonWeak ComparisonW/"1"W/"1"no matchmatchW/"1"W/"2"no matchno matchW/"1""1"no matchmatch"1""1"matchmatchAn entity tag is strong unless it is explicitly tagged as weak. Section 2 gives the syntax for entity tags.¶A Last-Modified time, when used as a validator in a request, is implicitly weak unless it is possible to deduce that it is strong, using the following rules: ¶The validator is being compared by an origin server to the actual current validator for the entity and,That origin server reliably knows that the associated entity did not change twice during the second covered by the presented validator.or ¶The validator is about to be used by a client in an If-Modified-Since or If-Unmodified-Since header, because the client has a cache entry for the associated entity, andThat cache entry includes a Date value, which gives the time when the origin server sent the original response, andThe presented Last-Modified time is at least 60 seconds before the Date value.or ¶The validator is being compared by an intermediate cache to the validator stored in its cache entry for the entity, andThat cache entry includes a Date value, which gives the time when the origin server sent the original response, andThe presented Last-Modified time is at least 60 seconds before the Date value.This method relies on the fact that if two different responses were sent by the origin server during the same second, but both had the same Last-Modified time, then at least one of those responses would have a Date value equal to its Last-Modified time. The arbitrary 60-second limit guards against the possibility that the Date and Last-Modified values are generated from different clocks, or at somewhat different times during the preparation of the response. An implementation MAY use a value larger than 60 seconds, if it is believed that 60 seconds is too short.¶If a client wishes to perform a sub-range retrieval on a value for which it has only a Last-Modified time and no opaque validator, it MAY do this only if the Last-Modified time is strong in the sense described here.¶A cache or origin server receiving a conditional range request ([Part5]) MUST use the strong comparison function to evaluate the condition.¶These rules allow HTTP/1.1 caches and clients to safely perform sub-range retrievals on values that have been obtained from HTTP/1.0 servers.¶5. Rules for When to Use Entity Tags and Last-Modified DatesWe adopt a set of rules and recommendations for origin servers, clients, and caches regarding when various validator types ought to 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 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 might persist for arbitrarily long periods, regardless of expiration times, so it might 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 origin server, upon receiving a conditional request that includes both a Last-Modified date (e.g., in an If-Modified-Since or If-Unmodified-Since header field) and one or more entity tags (e.g., in an If-Match, If-None-Match, or If-Range header field) as cache validators, MUST NOT return a response status of 304 (Not Modified) unless doing so is consistent with all of the conditional header fields in the request.¶An HTTP/1.1 caching proxy, upon receiving a conditional request that includes both a Last-Modified date and one or more entity tags as cache validators, MUST NOT return a locally cached response to the client unless that cached response is consistent with all of the conditional header fields in the request. ¶Note: 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.6. Header Field DefinitionsThis section defines the syntax and semantics of HTTP/1.1 header fields related to conditional requests.¶For entity-header fields, both sender and recipient refer to either the client or the server, depending on who sends and who receives the entity.¶6.1. ETagThe "ETag" response-header field provides the current value of the entity tag (see Section 2) for the requested variant, which may be used for comparison with other entities from the same resource (see Section 4).¶  ETag   = "ETag" ":" OWS ETag-v
The ETag response-header field value, an entity tag, provides for an "opaque" cache validator. This might allow more reliable validation in situations where it is inconvenient to store modification dates, where the one-second resolution of HTTP date values is not sufficient, or where the origin server wishes to avoid certain paradoxes that might arise from the use of modification dates.¶The principle behind entity tags is that only the service author knows the semantics of a resource well enough to select an appropriate cache validation mechanism, and the specification of any validator comparison function more complex than byte-equality would open up a can of worms. Thus, comparisons of any other headers (except Last-Modified, for compatibility with HTTP/1.0) are never used for purposes of validating a cache entry.¶6.2. If-MatchThe "If-Match" request-header field is used to make a request method conditional. A client that has one or more entities previously obtained from the resource can verify that one of those entities is current by including a list of their associated entity tags in the If-Match header field.¶This allows efficient updates of cached information with a minimum amount of transaction overhead. It is also used when updating resources, to prevent inadvertent modification of the wrong version of a resource. As a special case, the value "*" matches any current entity of the resource.¶  If-Match   = "If-Match" ":" OWS If-Match-v
If any of the entity tags match the entity tag of the entity that would have been returned in the response to a similar GET request (without the If-Match header) on that resource, or if "*" is given and any current entity exists for that resource, then the server MAY perform the requested method as if the If-Match header field did not exist.¶If none of the entity tags match, or if "*" is given and no current entity exists, the server MUST NOT perform the requested method, and MUST return a 412 (Precondition Failed) response. This behavior is most useful when the client wants to prevent an updating method, such as PUT, from modifying a resource that has changed since the client last retrieved it.¶If the request would, without the If-Match header field, result in anything other than a 2xx or 412 status, then the If-Match header MUST be ignored.¶The meaning of "If-Match: *" is that the method SHOULD be performed if the representation selected by the origin server (or by a cache, possibly using the Vary mechanism, see Section 3.5 of [Part6]) exists, and MUST NOT be performed if the representation does not exist.¶A request intended to update a resource (e.g., a PUT) MAY include an If-Match header field to signal that the request method MUST NOT be applied if the entity corresponding to the If-Match value (a single entity tag) is no longer a representation of that resource. This allows the user to indicate that they do not wish the request to be successful if the resource has been changed without their knowledge. Examples:¶  If-Match: "xyzzy"
The result of a request having both an If-Match header field and either an If-None-Match or an If-Modified-Since header fields is undefined by this specification.¶6.3. If-Modified-SinceThe "If-Modified-Since" request-header field is used to make a request method conditional: if the requested variant has not been modified since the time specified in this field, the server will not return an entity; instead, a 304 (Not Modified) response will be returned.¶  If-Modified-Since   = "If-Modified-Since" ":" OWS
A GET method with an If-Modified-Since header and no Range header requests that the identified entity be transferred only if it has been modified since the date given by the If-Modified-Since header. The algorithm for determining this includes the following cases: ¶If the request would normally result in anything other than a 200 (OK) status, or if the passed If-Modified-Since date is invalid, the response is exactly the same as for a normal GET. A date which is later than the server's current time is invalid.If the variant has been modified since the If-Modified-Since date, the response is exactly the same as for a normal GET.If the variant has not been modified since a valid If-Modified-Since date, the server SHOULD return a 304 (Not Modified) response.The purpose of this feature is to allow efficient updates of cached information with a minimum amount of transaction overhead. ¶Note: The Range request-header field modifies the meaning of If-Modified-Since; see Section 5.4 of [Part5] for full details.Note: If-Modified-Since times are interpreted by the server, whose clock might not be synchronized with the client.Note: When handling an If-Modified-Since header field, some servers will use an exact date comparison function, rather than a less-than function, for deciding whether to send a 304 (Not Modified) response. To get best results when sending an If-Modified-Since header field for cache validation, clients are advised to use the exact date string received in a previous Last-Modified header field whenever possible.Note: If a client uses an arbitrary date in the If-Modified-Since header instead of a date taken from the Last-Modified header for the same request, the client should be aware of the fact that this date is interpreted in the server's understanding of time. The client should consider unsynchronized clocks and rounding problems due to the different encodings of time between the client and server. This includes the possibility of race conditions if the document has changed between the time it was first requested and the If-Modified-Since date of a subsequent request, and the possibility of clock-skew-related problems if the If-Modified-Since date is derived from the client's clock without correction to the server's clock. Corrections for different time bases between client and server are at best approximate due to network latency.The result of a request having both an If-Modified-Since header field and either an If-Match or an If-Unmodified-Since header fields is undefined by this specification.¶6.4. If-None-MatchThe "If-None-Match" request-header field is used to make a request method conditional. A client that has one or more entities previously obtained from the resource can verify that none of those entities is current by including a list of their associated entity tags in the If-None-Match header field.¶This allows efficient updates of cached information with a minimum amount of transaction overhead. It is also used to prevent a method (e.g. PUT) from inadvertently modifying an existing resource when the client believes that the resource does not exist.¶As a special case, the value "*" matches any current entity of the resource.¶  If-None-Match   = "If-None-Match" ":" OWS If-None-Match-v
If any of the entity tags match the entity tag of the entity that would have been returned in the response to a similar GET request (without the If-None-Match header) on that resource, or if "*" is given and any current entity exists for that resource, then the server MUST NOT perform the requested method, unless required to do so because the resource's modification date fails to match that supplied in an If-Modified-Since header field in the request. Instead, if the request method was GET or HEAD, the server SHOULD respond with a 304 (Not Modified) response, including the cache-related header fields (particularly ETag) of one of the entities that matched. For all other request methods, the server MUST respond with a status of 412 (Precondition Failed).¶If none of the entity tags match, then the server MAY perform the requested method as if the If-None-Match header field did not exist, but MUST also ignore any If-Modified-Since header field(s) in the request. That is, if no entity tags match, then the server MUST NOT return a 304 (Not Modified) response.¶If the request would, without the If-None-Match header field, result in anything other than a 2xx or 304 status, then the If-None-Match header MUST be ignored. (See Section 5 for a discussion of server behavior when both If-Modified-Since and If-None-Match appear in the same request.)¶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 3.5 of [Part6]) exists, and SHOULD be performed if the representation does not exist. This feature is intended to be useful in preventing races between PUT operations.¶Examples:¶  If-None-Match: "xyzzy"
The result of a request having both an If-None-Match header field and either an If-Match or an If-Unmodified-Since header fields is undefined by this specification.¶6.5. If-Unmodified-SinceThe "If-Unmodified-Since" request-header field is used to make a request method conditional. If the requested resource has not been modified since the time specified in this field, the server SHOULD perform the requested operation as if the If-Unmodified-Since header were not present.¶If the requested variant has been modified since the specified time, the server MUST NOT perform the requested operation, and MUST return a 412 (Precondition Failed).¶  If-Unmodified-Since   = "If-Unmodified-Since" ":" OWS
If the request normally (i.e., without the If-Unmodified-Since header) would result in anything other than a 2xx or 412 status, the If-Unmodified-Since header SHOULD be ignored.¶If the specified date is invalid, the header is ignored.¶The result of a request having both an If-Unmodified-Since header field and either an If-None-Match or an If-Modified-Since header fields is undefined by this specification.¶6.6. Last-ModifiedThe "Last-Modified" entity-header field indicates the date and time at which the origin server believes the variant was last modified.¶  Last-Modified   = "Last-Modified" ":" OWS Last-Modified-v
The exact meaning of this header field depends on the implementation of the origin server and the nature of the original resource. For files, it may be just the file system last-modified time. For entities with dynamically included parts, it may be the most recent of the set of last-modify times for its component parts. For database gateways, it may be the last-update time stamp of the record. For virtual objects, it may be the last time the internal state changed.¶An origin server MUST NOT send a Last-Modified date which is later than the server's time of message origination. In such cases, where the resource's last modification would indicate some time in the future, the server MUST replace that date with the message origination date.¶An origin server SHOULD obtain the Last-Modified value of the entity as close as possible to the time that it generates the Date value of its response. This allows a recipient to make an accurate assessment of the entity's modification time, especially if the entity changes near the time that the response is generated.¶HTTP/1.1 servers SHOULD send Last-Modified whenever feasible.¶The Last-Modified entity-header field value is often used as a cache validator. In simple terms, a cache entry is considered to be valid if the entity has not been modified since the Last-Modified value.¶7. IANA Considerations7.1. Status Code RegistrationThe HTTP Status Code Registry located at <http://www.iana.org/assignments/http-status-codes> should be updated with the registrations below:¶ValueDescriptionReference304Not ModifiedSection 3.1 412Precondition FailedSection 3.2 7.2. Message Header RegistrationThe Message Header Registry located at <http://www.iana.org/assignments/message-headers/message-header-index.html> should be updated with the permanent registrations below (see [RFC3864]):¶Header Field NameProtocolStatusReferenceETaghttpstandardSection 6.1 If-MatchhttpstandardSection 6.2 If-Modified-SincehttpstandardSection 6.3 If-None-MatchhttpstandardSection 6.4 If-Unmodified-SincehttpstandardSection 6.5 Last-ModifiedhttpstandardSection 6.6 The change controller is: "IETF (iesg@ietf.org) - Internet Engineering Task Force".¶8. Security ConsiderationsNo additional security considerations have been identified beyond those applicable to HTTP in general [Part1].¶9. Acknowledgments10. References10.1. Normative References[Part1]Fielding, R., Ed., Gettys, J., Mogul, J., Frystyk, H., Masinter, L., Leach, P., Berners-Lee, T., Lafon, Y., Ed., and J. Reschke, Ed., “HTTP/1.1, part 1: URIs, Connections, and Message Parsing”, Internet-Draft draft-ietf-httpbis-p1-messaging-08 (work in progress), October 2009.[Part5]Fielding, R., Ed., Gettys, J., Mogul, J., Frystyk, H., Masinter, L., Leach, P., Berners-Lee, T., Lafon, Y., Ed., and J. Reschke, Ed., “HTTP/1.1, part 5: Range Requests and Partial Responses”, Internet-Draft draft-ietf-httpbis-p5-range-08 (work in progress), October 2009.[Part6]Fielding, R., Ed., Gettys, J., Mogul, J., Frystyk, H., Masinter, L., Leach, P., Berners-Lee, T., Lafon, Y., Ed., Nottingham, M., Ed., and J. Reschke, Ed., “HTTP/1.1, part 6: Caching”, Internet-Draft draft-ietf-httpbis-p6-cache-08 (work in progress), October 2009.[RFC2119]Bradner, S., “Key words for use in RFCs to Indicate Requirement Levels”, BCP 14, RFC 2119, March 1997.[RFC5234]Crocker, D., Ed. and P. Overell, “Augmented BNF for Syntax Specifications: ABNF”, STD 68, RFC 5234, January 2008.10.2. Informative References[RFC2616]Fielding, R., Gettys, J., Mogul, J., Frystyk, H., Masinter, L., Leach, P., and T. Berners-Lee, “Hypertext Transfer Protocol -- HTTP/1.1”, RFC 2616, June 1999.[RFC3864]Klyne, G., Nottingham, M., and J. Mogul, “Registration Procedures for Message Header Fields”, BCP 90, RFC 3864, September 2004.A. Compatibility with Previous VersionsA.1. Changes from RFC 2616Allow weak entity tags in all requests except range requests (Sections 4 and 6.4).¶B. Collected ABNFETag = "ETag:" OWS ETag-v
C. Change Log (to be removed by RFC Editor before publication)C.1. Since RFC2616Extracted relevant partitions from [RFC2616].¶C.2. Since draft-ietf-httpbis-p4-conditional-00Closed issues: ¶<http://tools.ietf.org/wg/httpbis/trac/ticket/35>: "Normative and Informative references"Other changes: ¶Move definitions of 304 and 412 condition codes from Part2.C.3. Since draft-ietf-httpbis-p4-conditional-01Ongoing work on ABNF conversion (<http://tools.ietf.org/wg/httpbis/trac/ticket/36>): ¶Add explicit references to BNF syntax and rules imported from other parts of the specification.C.4. Since draft-ietf-httpbis-p4-conditional-02Closed issues: ¶<http://tools.ietf.org/wg/httpbis/trac/ticket/116>: "Weak ETags on non-GET requests"Ongoing work on IANA Message Header Registration (<http://tools.ietf.org/wg/httpbis/trac/ticket/40>): ¶Reference RFC 3984, and update header registrations for headers defined in this document.C.5. Since draft-ietf-httpbis-p4-conditional-03Closed issues: ¶<http://tools.ietf.org/wg/httpbis/trac/ticket/71>: "Examples for ETag matching"<http://tools.ietf.org/wg/httpbis/trac/ticket/124>: "'entity value' undefined"<http://tools.ietf.org/wg/httpbis/trac/ticket/126>: "bogus 2068 Date header reference"C.6. Since draft-ietf-httpbis-p4-conditional-04Ongoing work on ABNF conversion (<http://tools.ietf.org/wg/httpbis/trac/ticket/36>): ¶Use "/" instead of "|" for alternatives.Introduce new ABNF rules for "bad" whitespace ("BWS"), optional whitespace ("OWS") and required whitespace ("RWS").Rewrite ABNFs to spell out whitespace rules, factor out header value format definitions.C.7. Since draft-ietf-httpbis-p4-conditional-05Final work on ABNF conversion (<http://tools.ietf.org/wg/httpbis/trac/ticket/36>): ¶Add appendix containing collected and expanded ABNF, reorganize ABNF introduction.C.8. Since draft-ietf-httpbis-p4-conditional-06Closed issues: ¶<http://tools.ietf.org/wg/httpbis/trac/ticket/153>: "case-sensitivity of etag weakness indicator"C.9. Since draft-ietf-httpbis-p4-conditional-07Closed issues: ¶<http://tools.ietf.org/wg/httpbis/trac/ticket/116>: "Weak ETags on non-GET requests" (If-Match still was defined to require strong matching)<http://tools.ietf.org/wg/httpbis/trac/ticket/198>: "move IANA registrations for optional status codes"Index3 4 E G H I L P R S 3304 Not Modified (status code) 3.1, 7.14412 Precondition Failed (status code) 3.2, 7.1EETag header 2, 6.1, 7.2GGrammar entity-tag 2ETag 6.1ETag-v 6.1If-Match 6.2If-Match-v 6.2If-Modified-Since 6.3If-Modified-Since-v 6.3If-None-Match 6.4If-None-Match-v 6.4If-Unmodified-Since 6.5If-Unmodified-Since-v 6.5Last-Modified 6.6Last-Modified-v 6.6opaque-tag 2weak 2HHeaders ETag 2, 6.1, 7.2If-Match 2, 6.2, 7.2If-Modified-Since 6.3, 7.2If-None-Match 2, 6.4, 7.2, A.1If-Unmodified-Since 6.5, 7.2Last-Modified 6.6, 7.2IIf-Match header 2, 6.2, 7.2If-Modified-Since header 6.3, 7.2If-None-Match header 2, 6.4, 7.2, A.1If-Unmodified-Since header 6.5, 7.2LLast-Modified header 6.6, 7.2PPart1 1.2, 1.2.1, 1.2.1, 1.2.1, 1.2.2, 3.1, 3.1, 8, 10.1Section 1.2 1.2Section 1.2.2 1.2.1, 1.2.1, 1.2.1Section 6.1 1.2.2Section 9.3.1 3.1Section 9.3 3.1Part5 2, 4, 4, 6.3, 10.1Section 5.3 2Section 5.4 6.3Part6 1, 6.2, 6.4, 10.1Section 3.5 6.2, 6.4RRFC2119 1.1, 10.1RFC2616 1, 10.2, C.1RFC3864 7.2, 10.2RFC5234 1.2, 1.2, 10.1Appendix B.1 1.2SStatus Codes 304 Not Modified 3.1, 7.1412 Precondition Failed 3.2, 7.1Authors' AddressesRoy T. Fielding (editor)Day Software23 Corporate Plaza DR, Suite 280Newport Beach, CA 92660USAPhone: +1-949-706-5300Fax: +1-949-706-5305EMail: fielding@gbiv.comURI: http://roy.gbiv.com/Jim GettysOne Laptop per Child21 Oak Knoll RoadCarlisle, MA 01741USAEMail: jg@laptop.orgURI: http://www.laptop.org/Jeffrey C. MogulHewlett-Packard CompanyHP Labs, Large Scale Systems Group1501 Page Mill Road, MS 1177Palo Alto, CA 94304USAEMail: JeffMogul@acm.orgHenrik Frystyk NielsenMicrosoft Corporation1 Microsoft WayRedmond, WA 98052USAEMail: henrikn@microsoft.comLarry MasinterAdobe Systems, Incorporated345 Park AveSan Jose, CA 95110USAEMail: LMM@acm.orgURI: http://larry.masinter.net/Paul J. LeachMicrosoft Corporation1 Microsoft WayRedmond, WA 98052EMail: paulle@microsoft.comTim Berners-LeeWorld Wide Web ConsortiumMIT Computer Science and Artificial Intelligence LaboratoryThe Stata Center, Building 3232 Vassar StreetCambridge, MA 02139USAEMail: timbl@w3.orgURI: http://www.w3.org/People/Berners-Lee/Yves Lafon (editor)World Wide Web ConsortiumW3C / ERCIM2004, rte des LuciolesSophia-Antipolis, AM 06902FranceEMail: ylafon@w3.orgURI: http://www.raubacapeu.net/people/yves/Julian F. Reschke (editor)greenbytes GmbHHafenweg 16Muenster, NW 48155GermanyPhone: +49 251 2807760Fax: +49 251 2807761EMail: julian.reschke@greenbytes.deURI: http://greenbytes.de/tech/webdav/