One document matched: draft-ietf-httpbis-p4-conditional-00.xml


<?xml version="1.0" encoding="UTF-8"?>
<!--
    This XML document is the output of clean-for-DTD.xslt; a tool that strips
    extensions to RFC2629(bis) from documents for processing with xml2rfc.
-->
<?rfc toc="yes" ?>
<?rfc symrefs="yes" ?>
<?rfc sortrefs="yes" ?>
<?rfc compact="yes"?>
<?rfc subcompact="no" ?>
<?rfc linkmailto="no" ?>
<?rfc editing="no" ?>
<!DOCTYPE rfc
  PUBLIC "" "rfc2629.dtd">
<rfc obsoletes="2068, 2616" category="std" ipr="full3978" docName="draft-ietf-httpbis-p4-conditional-00">
<front>

  <title abbrev="HTTP/1.1, part 4">HTTP/1.1, part 4: Conditional Requests</title>

  <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
    <organization abbrev="Day Software">Day Software</organization>
    <address>
      <postal>
        <street>23 Corporate Plaza DR, Suite 280</street>
        <city>Newport Beach</city>
        <region>CA</region>
        <code>92660</code>
        <country>USA</country>
      </postal>
      <phone>+1-949-706-5300</phone>
      <facsimile>+1-949-706-5305</facsimile>
      <email>fielding@gbiv.com</email>
      <uri>http://roy.gbiv.com/</uri>
    </address>
  </author>

  <author initials="J." surname="Gettys" fullname="Jim Gettys">
    <organization>One Laptop per Child</organization>
    <address>
      <postal>
        <street>21 Oak Knoll Road</street>
        <city>Carlisle</city>
        <region>MA</region>
        <code>01741</code>
        <country>USA</country>
      </postal>
      <email>jg@laptop.org</email>
      <uri>http://www.laptop.org/</uri>
    </address>
  </author>
  
  <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
    <organization abbrev="HP">Hewlett-Packard Company</organization>
    <address>
      <postal>
        <street>HP Labs, Large Scale Systems Group</street>
        <street>1501 Page Mill Road, MS 1177</street>
        <city>Palo Alto</city>
        <region>CA</region>
        <code>94304</code>
        <country>USA</country>
      </postal>
      <email>JeffMogul@acm.org</email>
    </address>
  </author>

  <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
    <organization abbrev="Microsoft">Microsoft Corporation</organization>
    <address>
      <postal>
        <street>1 Microsoft Way</street>
        <city>Redmond</city>
        <region>WA</region>
        <code>98052</code>
        <country>USA</country>
      </postal>
      <email>henrikn@microsoft.com</email>
    </address>
  </author>

  <author initials="L." surname="Masinter" fullname="Larry Masinter">
    <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization>
    <address>
      <postal>
        <street>345 Park Ave</street>
        <city>San Jose</city>
        <region>CA</region>
        <code>95110</code>
        <country>USA</country>
      </postal>
      <email>LMM@acm.org</email>
      <uri>http://larry.masinter.net/</uri>
    </address>
  </author>
  
  <author initials="P." surname="Leach" fullname="Paul J. Leach">
    <organization abbrev="Microsoft">Microsoft Corporation</organization>
    <address>
      <postal>
        <street>1 Microsoft Way</street>
        <city>Redmond</city>
        <region>WA</region>
        <code>98052</code>
      </postal>
      <email>paulle@microsoft.com</email>
    </address>
  </author>
   
  <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
    <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
    <address>
      <postal>
        <street>MIT Computer Science and Artificial Intelligence Laboratory</street>
        <street>The Stata Center, Building 32</street>
        <street>32 Vassar Street</street>
        <city>Cambridge</city>
        <region>MA</region>
        <code>02139</code>
        <country>USA</country>
      </postal>
      <email>timbl@w3.org</email>
      <uri>http://www.w3.org/People/Berners-Lee/</uri>
    </address>
  </author>

  <date month="December" year="2007"/>

<abstract>
<t>
   The 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.
</t>
</abstract>

<note title="Editorial Note (To be removed by RFC Editor)">
  <t>
    This version of the HTTP specification contains only minimal editorial
    changes from <xref target="RFC2616"/> (abstract, introductory paragraph,
    and authors' addresses).  All other changes are due to partitioning the
    original into seven mostly independent parts.  The intent is for readers
    of future drafts to able to use draft 00 as the basis for comparison
    when the WG makes later changes to the specification text.  This draft
    will shortly be followed by draft 01 (containing the first round of changes
    that have already been agreed to on the mailing list). There is no point in
    reviewing this draft other than to verify that the partitioning has been
    done correctly.  Roy T. Fielding, Yves Lafon, and Julian Reschke
    will be the editors after draft 00 is submitted.
  </t>
  <t>
    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 <eref target="http://www3.tools.ietf.org/wg/httpbis/trac/report/11"/>
    and related documents (including fancy diffs) can be found at
    <eref target="http://www3.tools.ietf.org/wg/httpbis/"/>.
  </t>
</note>
</front>
<middle>
<section title="Introduction" anchor="introduction">
<t>
   This document will define aspects of HTTP related to conditional
   request messages based on time stamps and entity-tags.  Right now it
   only includes the extracted relevant sections of <xref target="RFC2616">RFC 2616</xref>
   without edit.
</t>
</section>

<section title="Entity Tags" anchor="entity.tags">
<t>
   Entity tags are used for comparing two or more entities from the same
   requested resource. HTTP/1.1 uses entity tags in the ETag (<xref target="header.etag"/>),
   If-Match (<xref target="header.if-match"/>), If-None-Match (<xref target="header.if-none-match"/>), and
   If-Range (Section 5.3 of <xref target="Part5"/>) header fields. The definition of how they
   are used and compared as cache validators is in <xref target="weak.and.strong.validators"/>. An
   entity tag consists of an opaque quoted string, possibly prefixed by
   a weakness indicator.
</t>
<figure><iref primary="true" item="Grammar" subitem="entity-tag"/><iref primary="true" item="Grammar" subitem="weak"/><iref primary="true" item="Grammar" subitem="opaque-tag"/><artwork type="abnf2616"><![CDATA[
   entity-tag = [ weak ] opaque-tag
   weak       = "W/"
   opaque-tag = quoted-string
]]></artwork></figure>
<t>
   A "strong entity tag" MAY be shared by two entities of a resource
   only if they are equivalent by octet equality.
</t>
<t>
   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.
</t>
<t>
   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.
</t>
</section>

<section title="Status Code Definitions">
<section title="304 Not Modified" anchor="status.304">
  <iref primary="true" item="304 Not Modified (status code)"/>
  <iref primary="true" item="Status Codes" subitem="304 Not Modified"/>
<t>
   If 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.
</t>
<t>
   The response MUST include the following header fields:
  <list style="symbols">
    <t>Date, unless its omission is required by Section 8.3.1 of <xref target="Part1"/></t>
  </list>
</t>
<t>
   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 <xref target="RFC2068"/>, section 14.19), caches will operate
   correctly.
  <list style="symbols">
    <t>ETag and/or Content-Location, if the header would have been sent
        in a 200 response to the same request</t>
    <t>Expires, Cache-Control, and/or Vary, if the field-value might
        differ from that sent in any previous response for the same
        variant</t>
  </list>
</t>
<t>
   If the conditional GET used a strong cache validator (see <xref target="Part6"/>),
   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.
</t>
<t>
   If a 304 response indicates an entity not currently cached, then the
   cache MUST disregard the response and repeat the request without the
   conditional.
</t>
<t>
   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.
</t>
</section>

<section title="412 Precondition Failed" anchor="status.412">
  <iref primary="true" item="412 Precondition Failed (status code)"/>
  <iref primary="true" item="Status Codes" subitem="412 Precondition Failed"/>
<t>
   The 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.
</t>
</section>
</section>

<section title="Weak and Strong Validators" anchor="weak.and.strong.validators">
<t>
   Since 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."
</t>
<t>
   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."
</t>
<t>
   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.
  <list><t>
      Note: One example of a strong validator is an integer that is
      incremented in stable storage every time an entity is changed.
    </t><t>
      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.
    </t><t>
      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.
    </t></list>
</t>
<t>
   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.
</t>
<t>
   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.
</t>
<t>
   Clients MAY issue simple (non-subrange) GET requests with either weak
   validators or strong validators. Clients MUST NOT use weak validators
   in other forms of request.
</t>
<t>
   The only function that the HTTP/1.1 protocol 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:
  <list style="symbols">
     <t>The strong comparison function: in order to be considered equal,
        both validators MUST be identical in every way, and both MUST NOT
        be weak.</t>
     <t>The weak comparison function: in order to be considered equal,
        both validators MUST be identical in every way, but either or
        both of them MAY be tagged as "weak" without affecting the
        result.</t>
  </list>
</t>
<t>
   An entity tag is strong unless it is explicitly tagged as weak.
   <xref target="entity.tags"/> gives the syntax for entity tags.
</t>
<t>
   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:
  <list style="symbols">
     <t>The validator is being compared by an origin server to the
        actual current validator for the entity and,</t>
     <t>That origin server reliably knows that the associated entity did
        not change twice during the second covered by the presented
        validator.</t>
  </list>
</t>
<t>
   or
  <list style="symbols">
     <t>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, and</t>
     <t>That cache entry includes a Date value, which gives the time
        when the origin server sent the original response, and</t>
     <t>The presented Last-Modified time is at least 60 seconds before
        the Date value.</t>
  </list>
</t>
<t>
   or
  <list style="symbols">
     <t>The validator is being compared by an intermediate cache to the
        validator stored in its cache entry for the entity, and</t>
     <t>That cache entry includes a Date value, which gives the time
        when the origin server sent the original response, and</t>
     <t>The presented Last-Modified time is at least 60 seconds before
        the Date value.</t>
  </list>
</t>
<t>
   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.
</t>
<t>
   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.
</t>
<t>
   A cache or origin server receiving a conditional request, other than
   a full-body GET request, MUST use the strong comparison function to
   evaluate the condition.
</t>
<t>
   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.
</t>
</section>

<section title="Rules for When to Use Entity Tags and Last-Modified Dates" anchor="rules.for.when.to.use.entity.tags.and.last-modified.dates">
<t>
   We 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.
</t>
<t>
   HTTP/1.1 origin servers:
  <list style="symbols">
     <t>SHOULD send an entity tag validator unless it is not feasible to
        generate one.</t>

     <t>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.</t>

     <t>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.</t>
  </list>
</t>
<t>
   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.
</t>
<t>
   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.
  <list><t>
      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.
  </t></list>
</t>
<t>
   HTTP/1.1 clients:
  <list style="symbols">
     <t>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).</t>

     <t>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).</t>

     <t>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.</t>

     <t>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.</t>
  </list>
</t>
<t>
   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.
</t>
<t>
   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.
  <list><t>
      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.
  </t><t>
      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.
  </t></list>
</t>
</section>

<section title="Header Field Definitions" anchor="header.fields">
<t>
   This section defines the syntax and semantics of all standard
   HTTP/1.1 header fields. 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.
</t>

<section title="ETag" anchor="header.etag">
  <iref primary="true" item="ETag header"/>
  <iref primary="true" item="Headers" subitem="ETag"/>
<t>
   The ETag response-header field provides the current value of the
   entity tag for the requested variant. The headers used with entity
   tags are described in sections <xref target="header.if-match" format="counter"/>, <xref target="header.if-none-match" format="counter"/> and Section 5.3 of <xref target="Part5"/>. The entity tag
   MAY be used for comparison with other entities from the same resource
   (see <xref target="weak.and.strong.validators"/>).
</t>
<figure><iref primary="true" item="Grammar" subitem="ETag"/><artwork type="abnf2616"><![CDATA[
    ETag = "ETag" ":" entity-tag
]]></artwork></figure>
<figure><preamble>
   Examples:
</preamble>
<artwork type="example"><![CDATA[
   ETag: "xyzzy"
   ETag: W/"xyzzy"
   ETag: ""
]]></artwork></figure>
</section>

<section title="If-Match" anchor="header.if-match">
  <iref primary="true" item="If-Match header"/>
  <iref primary="true" item="Headers" subitem="If-Match"/>
<t>
   The If-Match request-header field is used with a method to make it
   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. Entity tags are defined in <xref target="entity.tags"/>. The
   purpose of this feature is to allow efficient updates of cached
   information with a minimum amount of transaction overhead. It is also
   used, on updating requests, to prevent inadvertent modification of
   the wrong version of a resource. As a special case, the value "*"
   matches any current entity of the resource.
</t>
<figure><iref primary="true" item="Grammar" subitem="If-Match"/><artwork type="abnf2616"><![CDATA[
    If-Match = "If-Match" ":" ( "*" | 1#entity-tag )
]]></artwork></figure>
<t>
   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.
</t>
<t>
   A server MUST use the strong comparison function (see <xref target="weak.and.strong.validators"/>)
   to compare the entity tags in If-Match.
</t>
<t>
   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.
</t>
<t>
   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.
</t>
<t>
   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 <xref target="Part6"/>) exists, and
   MUST NOT be performed if the representation does not exist.
</t>
<t>
   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:
</t>
<figure><artwork type="example"><![CDATA[
    If-Match: "xyzzy"
    If-Match: "xyzzy", "r2d2xxxx", "c3piozzzz"
    If-Match: *
]]></artwork></figure>
<t>
   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.
</t>
</section>

<section title="If-Modified-Since" anchor="header.if-modified-since">
  <iref primary="true" item="If-Modified-Since header"/>
  <iref primary="true" item="Headers" subitem="If-Modified-Since"/>
<t>
   The If-Modified-Since request-header field is used with a method to
   make it conditional: if the requested variant has not been modified
   since the time specified in this field, an entity will not be
   returned from the server; instead, a 304 (not modified) response will
   be returned without any message-body.
</t>
<figure><iref primary="true" item="Grammar" subitem="If-Modified-Since"/><artwork type="abnf2616"><![CDATA[
    If-Modified-Since = "If-Modified-Since" ":" HTTP-date
]]></artwork></figure>
<t>
   An example of the field is:
</t>
<figure><artwork type="example"><![CDATA[
    If-Modified-Since: Sat, 29 Oct 1994 19:43:31 GMT
]]></artwork></figure>
<t>
   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:
  <list style="numbers">
      <t>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.</t>

      <t>If the variant has been modified since the If-Modified-Since
         date, the response is exactly the same as for a normal GET.</t>

      <t>If the variant has not been modified since a valid If-Modified-Since
         date, the server SHOULD return a 304 (Not
         Modified) response.</t>
  </list>
</t>
<t>
   The purpose of this feature is to allow efficient updates of cached
   information with a minimum amount of transaction overhead.
  <list><t>
      Note: The Range request-header field modifies the meaning of If-Modified-Since;
      see Section 5.4 of <xref target="Part5"/> for full details.
    </t><t>
      Note: If-Modified-Since times are interpreted by the server, whose
      clock might not be synchronized with the client.
    </t><t>
      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.
    </t><t>
      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.
    </t>
  </list>
</t>
<t>
   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.
</t>
</section>

<section title="If-None-Match" anchor="header.if-none-match">
  <iref primary="true" item="If-None-Match header"/>
  <iref primary="true" item="Headers" subitem="If-None-Match"/>
<t>
   The If-None-Match request-header field is used with a method to make
   it 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. The purpose of this feature is to allow
   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.
</t>
<t>
   As a special case, the value "*" matches any current entity of the
   resource.
</t>
<figure><iref primary="true" item="Grammar" subitem="If-None-Match"/><artwork type="abnf2616"><![CDATA[
    If-None-Match = "If-None-Match" ":" ( "*" | 1#entity-tag )
]]></artwork></figure>
<t>
   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).
</t>
<t>
   See <xref target="weak.and.strong.validators"/> for rules on how to determine if two entities tags
   match. The weak comparison function can only be used with GET or HEAD
   requests.
</t>
<t>
   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.
</t>
<t>
   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 <xref target="rules.for.when.to.use.entity.tags.and.last-modified.dates"/> for a discussion of
   server behavior when both If-Modified-Since and If-None-Match appear
   in the same request.)
</t>
<t>
   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 <xref target="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.
</t>
<t>
   Examples:
</t>
<figure><artwork type="example"><![CDATA[
    If-None-Match: "xyzzy"
    If-None-Match: W/"xyzzy"
    If-None-Match: "xyzzy", "r2d2xxxx", "c3piozzzz"
    If-None-Match: W/"xyzzy", W/"r2d2xxxx", W/"c3piozzzz"
    If-None-Match: *
]]></artwork></figure>
<t>
   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.
</t>
</section>

<section title="If-Unmodified-Since" anchor="header.if-unmodified-since">
  <iref primary="true" item="If-Unmodified-Since header"/>
  <iref primary="true" item="Headers" subitem="If-Unmodified-Since"/>
<t>
   The If-Unmodified-Since request-header field is used with a method to
   make it 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.
</t>
<t>
   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).
</t>
<figure><iref primary="true" item="Grammar" subitem="If-Unmodified-Since"/><artwork type="abnf2616"><![CDATA[
   If-Unmodified-Since = "If-Unmodified-Since" ":" HTTP-date
]]></artwork></figure>
<t>
   An example of the field is:
</t>
<figure><artwork type="example"><![CDATA[
    If-Unmodified-Since: Sat, 29 Oct 1994 19:43:31 GMT
]]></artwork></figure>
<t>
   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.
</t>
<t>
   If the specified date is invalid, the header is ignored.
</t>
<t>
   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.
</t>
</section>

<section title="Last-Modified" anchor="header.last-modified">
  <iref primary="true" item="Last-Modified header"/>
  <iref primary="true" item="Headers" subitem="Last-Modified"/>
<t>
   The Last-Modified entity-header field indicates the date and time at
   which the origin server believes the variant was last modified.
</t>
<figure><iref primary="true" item="Grammar" subitem="Last-Modified"/><artwork type="abnf2616"><![CDATA[
    Last-Modified  = "Last-Modified" ":" HTTP-date
]]></artwork></figure>
<t>
   An example of its use is
</t>
<figure><artwork type="example"><![CDATA[
    Last-Modified: Tue, 15 Nov 1994 12:45:26 GMT
]]></artwork></figure>
<t>
   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.
</t>
<t>
   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.
</t>
<t>
   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.
</t>
<t>
   HTTP/1.1 servers SHOULD send Last-Modified whenever feasible.
</t>
</section>

</section>

<section title="IANA Considerations" anchor="IANA.considerations">
<t>
   TBD.
</t>
</section>

<section title="Security Considerations" anchor="security.considerations">
<t>
   No additional security considerations have been identified beyond
   those applicable to HTTP in general <xref target="Part1"/>.
</t>
</section>

<section title="Acknowledgments" anchor="ack">
<t>
   Based on an XML translation of RFC 2616 by Julian Reschke.
</t>
</section>
</middle>
<back>
<references>
   
<reference anchor="Part1">
   <front>
      <title abbrev="HTTP/1.1">HTTP/1.1, part 1: URIs, Connections, and Message Parsing</title>
      <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
         <organization abbrev="Day Software">Day Software</organization>
         <address><email>fielding@gbiv.com</email></address>
      </author>
      <author initials="J." surname="Gettys" fullname="Jim Gettys">
         <organization>One Laptop per Child</organization>
         <address><email>jg@laptop.org</email></address>
      </author>
      <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
         <organization abbrev="HP">Hewlett-Packard Company</organization>
         <address><email>JeffMogul@acm.org</email></address>
      </author>
      <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
         <organization abbrev="Microsoft">Microsoft Corporation</organization>
         <address><email>henrikn@microsoft.com</email></address>
      </author>
      <author initials="L." surname="Masinter" fullname="Larry Masinter">
         <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization>
         <address><email>LMM@acm.org</email></address>
      </author>
      <author initials="P." surname="Leach" fullname="Paul J. Leach">
         <organization abbrev="Microsoft">Microsoft Corporation</organization>
         <address><email>paulle@microsoft.com</email></address>
      </author>
      <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
         <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
         <address><email>timbl@w3.org</email></address>
      </author>
      <date month="December" year="2007"/>
   </front>
   <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p1-messaging-00"/>
   
</reference>

<reference anchor="Part5">
   <front>
      <title abbrev="HTTP/1.1">HTTP/1.1, part 5: Range Requests and Partial Responses</title>
      <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
         <organization abbrev="Day Software">Day Software</organization>
         <address><email>fielding@gbiv.com</email></address>
      </author>
      <author initials="J." surname="Gettys" fullname="Jim Gettys">
         <organization>One Laptop per Child</organization>
         <address><email>jg@laptop.org</email></address>
      </author>
      <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
         <organization abbrev="HP">Hewlett-Packard Company</organization>
         <address><email>JeffMogul@acm.org</email></address>
      </author>
      <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
         <organization abbrev="Microsoft">Microsoft Corporation</organization>
         <address><email>henrikn@microsoft.com</email></address>
      </author>
      <author initials="L." surname="Masinter" fullname="Larry Masinter">
         <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization>
         <address><email>LMM@acm.org</email></address>
      </author>
      <author initials="P." surname="Leach" fullname="Paul J. Leach">
         <organization abbrev="Microsoft">Microsoft Corporation</organization>
         <address><email>paulle@microsoft.com</email></address>
      </author>
      <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
         <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
         <address><email>timbl@w3.org</email></address>
      </author>
      <date month="December" year="2007"/>
   </front>
   <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p5-range-00"/>
   
</reference>

<reference anchor="Part6">
   <front>
      <title abbrev="HTTP/1.1">HTTP/1.1, part 6: Caching</title>
      <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
         <organization abbrev="Day Software">Day Software</organization>
         <address><email>fielding@gbiv.com</email></address>
      </author>
      <author initials="J." surname="Gettys" fullname="Jim Gettys">
         <organization>One Laptop per Child</organization>
         <address><email>jg@laptop.org</email></address>
      </author>
      <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
         <organization abbrev="HP">Hewlett-Packard Company</organization>
         <address><email>JeffMogul@acm.org</email></address>
      </author>
      <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
         <organization abbrev="Microsoft">Microsoft Corporation</organization>
         <address><email>henrikn@microsoft.com</email></address>
      </author>
      <author initials="L." surname="Masinter" fullname="Larry Masinter">
         <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization>
         <address><email>LMM@acm.org</email></address>
      </author>
      <author initials="P." surname="Leach" fullname="Paul J. Leach">
         <organization abbrev="Microsoft">Microsoft Corporation</organization>
         <address><email>paulle@microsoft.com</email></address>
      </author>
      <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
         <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
         <address><email>timbl@w3.org</email></address>
      </author>
      <date month="December" year="2007"/>
   </front>
   <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p6-cache-00"/>
   
</reference>

<reference anchor="RFC2616">
   <front>
      <title>Hypertext Transfer Protocol -- HTTP/1.1</title>
      <author initials="R." surname="Fielding" fullname="R. Fielding">
         <organization>University of California, Irvine</organization>
         <address><email>fielding@ics.uci.edu</email></address>
      </author>
      <author initials="J." surname="Gettys" fullname="J. Gettys">
         <organization>W3C</organization>
         <address><email>jg@w3.org</email></address>
      </author>
      <author initials="J." surname="Mogul" fullname="J. Mogul">
         <organization>Compaq Computer Corporation</organization>
         <address><email>mogul@wrl.dec.com</email></address>
      </author>
      <author initials="H." surname="Frystyk" fullname="H. Frystyk">
         <organization>MIT Laboratory for Computer Science</organization>
         <address><email>frystyk@w3.org</email></address>
      </author>
      <author initials="L." surname="Masinter" fullname="L. Masinter">
         <organization>Xerox Corporation</organization>
         <address><email>masinter@parc.xerox.com</email></address>
      </author>
      <author initials="P." surname="Leach" fullname="P. Leach">
         <organization>Microsoft Corporation</organization>
         <address><email>paulle@microsoft.com</email></address>
      </author>
      <author initials="T." surname="Berners-Lee" fullname="T. Berners-Lee">
         <organization>W3C</organization>
         <address><email>timbl@w3.org</email></address>
      </author>
      <date month="June" year="1999"/>
   </front>
   <seriesInfo name="RFC" value="2616"/>
</reference>

<reference anchor="RFC2068">
<front>
<title abbrev="HTTP/1.1">Hypertext Transfer Protocol -- HTTP/1.1</title>
<author initials="R." surname="Fielding" fullname="Roy T. Fielding">
<organization>University of California, Irvine, Department of Information and Computer Science</organization>
<address>
<postal>
<street/>
<city>Irvine</city>
<region>CA</region>
<code>92717-3425</code>
<country>US</country></postal>
<facsimile>+1 714 824 4056</facsimile>
<email>fielding@ics.uci.edu</email></address></author>
<author initials="J." surname="Gettys" fullname="Jim Gettys">
<organization>MIT Laboratory for Computer Science</organization>
<address>
<postal>
<street>545 Technology Square</street>
<city>Cambridge</city>
<region>MA</region>
<code>02139</code>
<country>US</country></postal>
<facsimile>+1 617 258 8682</facsimile>
<email>jg@w3.org</email></address></author>
<author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
<organization>Digital Equipment Corporation, Western Research Laboratory</organization>
<address>
<postal>
<street>250 University Avenue</street>
<city>Palo Alto</city>
<region>CA</region>
<code>94301</code>
<country>US</country></postal>
<email>mogul@wrl.dec.com</email></address></author>
<author initials="H." surname="Nielsen" fullname="Henrik Frystyk Nielsen">
<organization>MIT Laboratory for Computer Science</organization>
<address>
<postal>
<street>545 Technology Square</street>
<city>Cambridge</city>
<region>MA</region>
<code>02139</code>
<country>US</country></postal>
<facsimile>+1 617 258 8682</facsimile>
<email>frystyk@w3.org</email></address></author>
<author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
<organization>MIT Laboratory for Computer Science</organization>
<address>
<postal>
<street>545 Technology Square</street>
<city>Cambridge</city>
<region>MA</region>
<code>02139</code>
<country>US</country></postal>
<facsimile>+1 617 258 8682</facsimile>
<email>timbl@w3.org</email></address></author>
<date month="January" year="1997"/>
<abstract>
<t>The Hypertext Transfer Protocol (HTTP) is an application-level protocol for distributed, collaborative, hypermedia information systems. It is a generic, stateless, object-oriented protocol which can be used for many tasks, such as name servers and distributed object management systems, through extension of its request methods. A feature of HTTP is the typing and negotiation of data representation, allowing systems to be built independently of the data being transferred.</t>
<t>HTTP has been in use by the World-Wide Web global information initiative since 1990. This specification defines the protocol referred to as "HTTP/1.1".</t></abstract></front>
<seriesInfo name="RFC" value="2068"/>
</reference>

</references>
</back>
</rfc>

PAFTECH AB 2003-20262026-04-24 01:18:21