Ignore:
Timestamp:
Apr 1, 2010, 6:37:58 AM (9 years ago)
Author:
julian.reschke@…
Message:

Add an example for an ETag varying based on the Accept-Encoding (related to #39)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • draft-ietf-httpbis/latest/p4-conditional.html

    r799 r800  
    536536            </ul>
    537537         </li>
    538          <li class="tocline0">2.&nbsp;&nbsp;&nbsp;<a href="#entity.tags">Entity Tags</a></li>
     538         <li class="tocline0">2.&nbsp;&nbsp;&nbsp;<a href="#entity.tags">Entity Tags</a><ul class="toc">
     539               <li class="tocline1">2.1&nbsp;&nbsp;&nbsp;<a href="#example.entity.tag.vs.conneg">Example: Entity Tags varying on Content-Negotiated Resources</a></li>
     540            </ul>
     541         </li>
    539542         <li class="tocline0">3.&nbsp;&nbsp;&nbsp;<a href="#rfc.section.3">Status Code Definitions</a><ul class="toc">
    540543               <li class="tocline1">3.1&nbsp;&nbsp;&nbsp;<a href="#status.304">304 Not Modified</a></li>
     
    637640         obtained by requests on different URIs does not imply the equivalence of those entities.
    638641      </p>
     642      <h2 id="rfc.section.2.1"><a href="#rfc.section.2.1">2.1</a>&nbsp;<a id="example.entity.tag.vs.conneg" href="#example.entity.tag.vs.conneg">Example: Entity Tags varying on Content-Negotiated Resources</a></h2>
     643      <p id="rfc.section.2.1.p.1">Consider a resource that is subject to content negotiation (<a href="p3-payload.html#content.negotiation" title="Content Negotiation">Section 4</a> of <a href="#Part3" id="rfc.xref.Part3.1"><cite title="HTTP/1.1, part 3: Message Payload and Content Negotiation">[Part3]</cite></a>), and where the representations returned upon a GET request vary based on the Accept-Encoding request header field (<a href="p3-payload.html#header.accept-encoding" title="Accept-Encoding">Section 5.3</a> of <a href="#Part3" id="rfc.xref.Part3.2"><cite title="HTTP/1.1, part 3: Message Payload and Content Negotiation">[Part3]</cite></a>):
     644      </p>
     645      <div id="rfc.figure.u.4"></div>
     646      <p>&gt;&gt; Request:</p><pre class="text2">GET /index HTTP/1.1
     647Host: www.example.com
     648Accept-Encoding: gzip
     649
     650</pre><p id="rfc.section.2.1.p.3">In this case, the response may use the gzip Content Coding or not. If it does, it might look like that:</p>
     651      <div id="rfc.figure.u.5"></div>
     652      <p>&gt;&gt; Response:</p><pre class="text">HTTP/1.1 200 OK
     653Date: Thu, 26 Mar 2010 00:05:00 GMT
     654ETag: "123-a"
     655Content-Length: 70
     656Vary: Accept-Encoding
     657Content-Type: text/plain
     658
     659<span id="exbody">Hello World!
     660Hello World!
     661Hello World!
     662Hello World!
     663Hello World!
     664</span></pre><p id="rfc.section.2.1.p.5">A variant that does use gzip Content Coding would be:</p>
     665      <div id="rfc.figure.u.6"></div>
     666      <p>&gt;&gt; Response:</p><pre class="text">HTTP/1.1 200 OK
     667Date: Thu, 26 Mar 2010 00:05:00 GMT
     668ETag: "123-b"
     669Content-Length: 43
     670Vary: Accept-Encoding
     671Content-Type: text/plain
     672Content-Encoding: gzip
     673
     674<em>...binary data...</em></pre><div class="note" id="rfc.section.2.1.p.7">
     675         <p> <b>Note:</b> Content Codings are a property of the response entity, thus affect the Entity Tag. An alternative are Transfer Codings (<a href="p1-messaging.html#transfer.codings" title="Transfer Codings">Section 6.2</a> of <a href="#Part1" id="rfc.xref.Part1.6"><cite title="HTTP/1.1, part 1: URIs, Connections, and Message Parsing">[Part1]</cite></a>) which apply only to the transfer of the message, and thus do not require assigning distinct entity tags.
     676         </p>
     677      </div>
    639678      <h1 id="rfc.section.3"><a href="#rfc.section.3">3.</a>&nbsp;Status Code Definitions
    640679      </h1>
     
    648687      <ul>
    649688         <li>
    650             <p>Date, unless its omission is required by <a href="p1-messaging.html#clockless.origin.server.operation" title="Clockless Origin Server Operation">Section 9.3.1</a> of <a href="#Part1" id="rfc.xref.Part1.6"><cite title="HTTP/1.1, part 1: URIs, Connections, and Message Parsing">[Part1]</cite></a>.
     689            <p>Date, unless its omission is required by <a href="p1-messaging.html#clockless.origin.server.operation" title="Clockless Origin Server Operation">Section 9.3.1</a> of <a href="#Part1" id="rfc.xref.Part1.7"><cite title="HTTP/1.1, part 1: URIs, Connections, and Message Parsing">[Part1]</cite></a>.
    651690            </p>
    652691            <p>If a clockless origin server obeys these rules, and proxies and clients add their own Date to any response received without
    653                one (as already specified by <a href="p1-messaging.html#header.date" title="Date">Section 9.3</a> of <a href="#Part1" id="rfc.xref.Part1.7"><cite title="HTTP/1.1, part 1: URIs, Connections, and Message Parsing">[Part1]</cite></a>, caches will operate correctly.
     692               one (as already specified by <a href="p1-messaging.html#header.date" title="Date">Section 9.3</a> of <a href="#Part1" id="rfc.xref.Part1.8"><cite title="HTTP/1.1, part 1: URIs, Connections, and Message Parsing">[Part1]</cite></a>, caches will operate correctly.
    654693            </p>
    655694         </li>
     
    868907      <p id="rfc.section.6.1.p.1">The "ETag" response-header field provides the current value of the entity tag (see <a href="#entity.tags" title="Entity Tags">Section&nbsp;2</a>) for the requested variant, which may be used for comparison with other entities from the same resource (see <a href="#weak.and.strong.validators" title="Weak and Strong Validators">Section&nbsp;4</a>).
    869908      </p>
    870       <div id="rfc.figure.u.4"></div><pre class="inline"><span id="rfc.iref.g.4"></span><span id="rfc.iref.g.5"></span>  <a href="#header.etag" class="smpl">ETag</a>   = "ETag" ":" <a href="#core.rules" class="smpl">OWS</a> <a href="#header.etag" class="smpl">ETag-v</a>
     909      <div id="rfc.figure.u.7"></div><pre class="inline"><span id="rfc.iref.g.4"></span><span id="rfc.iref.g.5"></span>  <a href="#header.etag" class="smpl">ETag</a>   = "ETag" ":" <a href="#core.rules" class="smpl">OWS</a> <a href="#header.etag" class="smpl">ETag-v</a>
    871910  <a href="#header.etag" class="smpl">ETag-v</a> = <a href="#entity.tags" class="smpl">entity-tag</a>
    872 </pre><div id="rfc.figure.u.5"></div>
     911</pre><div id="rfc.figure.u.8"></div>
    873912      <p>Examples:</p>  <pre class="text">  ETag: "xyzzy"
    874913  ETag: W/"xyzzy"
     
    895934         any current entity of the resource.
    896935      </p>
    897       <div id="rfc.figure.u.6"></div><pre class="inline"><span id="rfc.iref.g.6"></span><span id="rfc.iref.g.7"></span>  <a href="#header.if-match" class="smpl">If-Match</a>   = "If-Match" ":" <a href="#core.rules" class="smpl">OWS</a> <a href="#header.if-match" class="smpl">If-Match-v</a>
     936      <div id="rfc.figure.u.9"></div><pre class="inline"><span id="rfc.iref.g.6"></span><span id="rfc.iref.g.7"></span>  <a href="#header.if-match" class="smpl">If-Match</a>   = "If-Match" ":" <a href="#core.rules" class="smpl">OWS</a> <a href="#header.if-match" class="smpl">If-Match-v</a>
    898937  <a href="#header.if-match" class="smpl">If-Match-v</a> = "*" / 1#<a href="#entity.tags" class="smpl">entity-tag</a>
    899938</pre><p id="rfc.section.6.2.p.4">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
     
    913952         their knowledge. Examples:
    914953      </p>
    915       <div id="rfc.figure.u.7"></div><pre class="text">  If-Match: "xyzzy"
     954      <div id="rfc.figure.u.10"></div><pre class="text">  If-Match: "xyzzy"
    916955  If-Match: "xyzzy", "r2d2xxxx", "c3piozzzz"
    917956  If-Match: *
     
    926965         response will be returned.
    927966      </p>
    928       <div id="rfc.figure.u.8"></div><pre class="inline"><span id="rfc.iref.g.8"></span><span id="rfc.iref.g.9"></span>  <a href="#header.if-modified-since" class="smpl">If-Modified-Since</a>   = "If-Modified-Since" ":" <a href="#core.rules" class="smpl">OWS</a>
     967      <div id="rfc.figure.u.11"></div><pre class="inline"><span id="rfc.iref.g.8"></span><span id="rfc.iref.g.9"></span>  <a href="#header.if-modified-since" class="smpl">If-Modified-Since</a>   = "If-Modified-Since" ":" <a href="#core.rules" class="smpl">OWS</a>
    929968                        <a href="#header.if-modified-since" class="smpl">If-Modified-Since-v</a>
    930969  <a href="#header.if-modified-since" class="smpl">If-Modified-Since-v</a> = <a href="#abnf.dependencies" class="smpl">HTTP-date</a>
    931970</pre><p id="rfc.section.6.3.p.3">An example of the field is:</p>
    932       <div id="rfc.figure.u.9"></div><pre class="text">  If-Modified-Since: Sat, 29 Oct 1994 19:43:31 GMT
     971      <div id="rfc.figure.u.12"></div><pre class="text">  If-Modified-Since: Sat, 29 Oct 1994 19:43:31 GMT
    933972</pre><p id="rfc.section.6.3.p.5">A GET method with an If-Modified-Since header and no Range header requests that the identified entity be transferred only
    934973         if it has been modified since the date given by the If-Modified-Since header. The algorithm for determining this includes
     
    9781017      </p>
    9791018      <p id="rfc.section.6.4.p.3">As a special case, the value "*" matches any current entity of the resource.</p>
    980       <div id="rfc.figure.u.10"></div><pre class="inline"><span id="rfc.iref.g.10"></span><span id="rfc.iref.g.11"></span>  <a href="#header.if-none-match" class="smpl">If-None-Match</a>   = "If-None-Match" ":" <a href="#core.rules" class="smpl">OWS</a> <a href="#header.if-none-match" class="smpl">If-None-Match-v</a>
     1019      <div id="rfc.figure.u.13"></div><pre class="inline"><span id="rfc.iref.g.10"></span><span id="rfc.iref.g.11"></span>  <a href="#header.if-none-match" class="smpl">If-None-Match</a>   = "If-None-Match" ":" <a href="#core.rules" class="smpl">OWS</a> <a href="#header.if-none-match" class="smpl">If-None-Match-v</a>
    9811020  <a href="#header.if-none-match" class="smpl">If-None-Match-v</a> = "*" / 1#<a href="#entity.tags" class="smpl">entity-tag</a>
    9821021</pre><p id="rfc.section.6.4.p.5">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
     
    9941033      </p>
    9951034      <p id="rfc.section.6.4.p.9">Examples:</p>
    996       <div id="rfc.figure.u.11"></div><pre class="text">  If-None-Match: "xyzzy"
     1035      <div id="rfc.figure.u.14"></div><pre class="text">  If-None-Match: "xyzzy"
    9971036  If-None-Match: W/"xyzzy"
    9981037  If-None-Match: "xyzzy", "r2d2xxxx", "c3piozzzz"
     
    10101049      <p id="rfc.section.6.5.p.2">If the requested variant has been modified since the specified time, the server <em class="bcp14">MUST NOT</em> perform the requested operation, and <em class="bcp14">MUST</em> return a 412 (Precondition Failed).
    10111050      </p>
    1012       <div id="rfc.figure.u.12"></div><pre class="inline"><span id="rfc.iref.g.12"></span><span id="rfc.iref.g.13"></span>  <a href="#header.if-unmodified-since" class="smpl">If-Unmodified-Since</a>   = "If-Unmodified-Since" ":" <a href="#core.rules" class="smpl">OWS</a>
     1051      <div id="rfc.figure.u.15"></div><pre class="inline"><span id="rfc.iref.g.12"></span><span id="rfc.iref.g.13"></span>  <a href="#header.if-unmodified-since" class="smpl">If-Unmodified-Since</a>   = "If-Unmodified-Since" ":" <a href="#core.rules" class="smpl">OWS</a>
    10131052                          <a href="#header.if-unmodified-since" class="smpl">If-Unmodified-Since-v</a>
    10141053  <a href="#header.if-unmodified-since" class="smpl">If-Unmodified-Since-v</a> = <a href="#abnf.dependencies" class="smpl">HTTP-date</a>
    10151054</pre><p id="rfc.section.6.5.p.4">An example of the field is:</p>
    1016       <div id="rfc.figure.u.13"></div><pre class="text">  If-Unmodified-Since: Sat, 29 Oct 1994 19:43:31 GMT
     1055      <div id="rfc.figure.u.16"></div><pre class="text">  If-Unmodified-Since: Sat, 29 Oct 1994 19:43:31 GMT
    10171056</pre><p id="rfc.section.6.5.p.6">If the request normally (i.e., without the If-Unmodified-Since header) would result in anything other than a 2xx or 412 status,
    10181057         the If-Unmodified-Since header <em class="bcp14">SHOULD</em> be ignored.
     
    10281067         modified.
    10291068      </p>
    1030       <div id="rfc.figure.u.14"></div><pre class="inline"><span id="rfc.iref.g.14"></span><span id="rfc.iref.g.15"></span>  <a href="#header.last-modified" class="smpl">Last-Modified</a>   = "Last-Modified" ":" <a href="#core.rules" class="smpl">OWS</a> <a href="#header.last-modified" class="smpl">Last-Modified-v</a>
     1069      <div id="rfc.figure.u.17"></div><pre class="inline"><span id="rfc.iref.g.14"></span><span id="rfc.iref.g.15"></span>  <a href="#header.last-modified" class="smpl">Last-Modified</a>   = "Last-Modified" ":" <a href="#core.rules" class="smpl">OWS</a> <a href="#header.last-modified" class="smpl">Last-Modified-v</a>
    10311070  <a href="#header.last-modified" class="smpl">Last-Modified-v</a> = <a href="#abnf.dependencies" class="smpl">HTTP-date</a>
    10321071</pre><p id="rfc.section.6.6.p.3">An example of its use is</p>
    1033       <div id="rfc.figure.u.15"></div><pre class="text">  Last-Modified: Tue, 15 Nov 1994 12:45:26 GMT
     1072      <div id="rfc.figure.u.18"></div><pre class="text">  Last-Modified: Tue, 15 Nov 1994 12:45:26 GMT
    10341073</pre><p id="rfc.section.6.6.p.5">The exact meaning of this header field depends on the implementation of the origin server and the nature of the original resource.
    10351074         For files, it may be just the file system last-modified time. For entities with dynamically included parts, it may be the
     
    11411180      <p id="rfc.section.7.2.p.2">The change controller is: "IETF (iesg@ietf.org) - Internet Engineering Task Force".</p>
    11421181      <h1 id="rfc.section.8"><a href="#rfc.section.8">8.</a>&nbsp;<a id="security.considerations" href="#security.considerations">Security Considerations</a></h1>
    1143       <p id="rfc.section.8.p.1">No additional security considerations have been identified beyond those applicable to HTTP in general <a href="#Part1" id="rfc.xref.Part1.8"><cite title="HTTP/1.1, part 1: URIs, Connections, and Message Parsing">[Part1]</cite></a>.
     1182      <p id="rfc.section.8.p.1">No additional security considerations have been identified beyond those applicable to HTTP in general <a href="#Part1" id="rfc.xref.Part1.9"><cite title="HTTP/1.1, part 1: URIs, Connections, and Message Parsing">[Part1]</cite></a>.
    11441183      </p>
    11451184      <h1 id="rfc.section.9"><a href="#rfc.section.9">9.</a>&nbsp;<a id="ack" href="#ack">Acknowledgments</a></h1>
     
    11481187      <h2 id="rfc.references.1"><a href="#rfc.section.10.1" id="rfc.section.10.1">10.1</a> Normative References
    11491188      </h2>
    1150       <table>         
     1189      <table>           
    11511190         <tr>
    11521191            <td class="reference"><b id="Part1">[Part1]</b></td>
    11531192            <td class="top"><a href="mailto:fielding@gbiv.com" title="Day Software">Fielding, R., Ed.</a>, <a href="mailto:jg@laptop.org" title="One Laptop per Child">Gettys, J.</a>, <a href="mailto:JeffMogul@acm.org" title="Hewlett-Packard Company">Mogul, J.</a>, <a href="mailto:henrikn@microsoft.com" title="Microsoft Corporation">Frystyk, H.</a>, <a href="mailto:LMM@acm.org" title="Adobe Systems, Incorporated">Masinter, L.</a>, <a href="mailto:paulle@microsoft.com" title="Microsoft Corporation">Leach, P.</a>, <a href="mailto:timbl@w3.org" title="World Wide Web Consortium">Berners-Lee, T.</a>, <a href="mailto:ylafon@w3.org" title="World Wide Web Consortium">Lafon, Y., Ed.</a>, and <a href="mailto:julian.reschke@greenbytes.de" title="greenbytes GmbH">J. F. Reschke, Ed.</a>, “<a href="http://tools.ietf.org/html/draft-ietf-httpbis-p1-messaging-latest">HTTP/1.1, part 1: URIs, Connections, and Message Parsing</a>”, Internet-Draft&nbsp;draft-ietf-httpbis-p1-messaging-latest (work in progress), April&nbsp;2010.
     1193            </td>
     1194         </tr>
     1195         <tr>
     1196            <td class="reference"><b id="Part3">[Part3]</b></td>
     1197            <td class="top"><a href="mailto:fielding@gbiv.com" title="Day Software">Fielding, R., Ed.</a>, <a href="mailto:jg@laptop.org" title="One Laptop per Child">Gettys, J.</a>, <a href="mailto:JeffMogul@acm.org" title="Hewlett-Packard Company">Mogul, J.</a>, <a href="mailto:henrikn@microsoft.com" title="Microsoft Corporation">Frystyk, H.</a>, <a href="mailto:LMM@acm.org" title="Adobe Systems, Incorporated">Masinter, L.</a>, <a href="mailto:paulle@microsoft.com" title="Microsoft Corporation">Leach, P.</a>, <a href="mailto:timbl@w3.org" title="World Wide Web Consortium">Berners-Lee, T.</a>, <a href="mailto:ylafon@w3.org" title="World Wide Web Consortium">Lafon, Y., Ed.</a>, and <a href="mailto:julian.reschke@greenbytes.de" title="greenbytes GmbH">J. F. Reschke, Ed.</a>, “<a href="http://tools.ietf.org/html/draft-ietf-httpbis-p3-payload-latest">HTTP/1.1, part 3: Message Payload and Content Negotiation</a>”, Internet-Draft&nbsp;draft-ietf-httpbis-p3-payload-latest (work in progress), April&nbsp;2010.
    11541198            </td>
    11551199         </tr>
     
    12121256      </p>
    12131257      <h1 id="rfc.section.B"><a href="#rfc.section.B">B.</a>&nbsp;<a id="collected.abnf" href="#collected.abnf">Collected ABNF</a></h1>
    1214       <div id="rfc.figure.u.16"></div> <pre class="inline"><a href="#header.etag" class="smpl">ETag</a> = "ETag:" OWS ETag-v
     1258      <div id="rfc.figure.u.19"></div> <pre class="inline"><a href="#header.etag" class="smpl">ETag</a> = "ETag:" OWS ETag-v
    12151259<a href="#header.etag" class="smpl">ETag-v</a> = entity-tag
    12161260
     
    12411285
    12421286<a href="#entity.tags" class="smpl">weak</a> = %x57.2F ; W/
    1243 </pre> <div id="rfc.figure.u.17"></div>
     1287</pre> <div id="rfc.figure.u.20"></div>
    12441288      <p>ABNF diagnostics:</p><pre class="inline">; ETag defined but not used
    12451289; If-Match defined but not used
     
    13881432            </li>
    13891433            <li class="indline0"><a id="rfc.index.P" href="#rfc.index.P"><b>P</b></a><ul class="ind">
    1390                   <li class="indline1"><em>Part1</em>&nbsp;&nbsp;<a class="iref" href="#rfc.xref.Part1.1">1.2</a>, <a class="iref" href="#rfc.xref.Part1.2">1.2.1</a>, <a class="iref" href="#rfc.xref.Part1.3">1.2.1</a>, <a class="iref" href="#rfc.xref.Part1.4">1.2.1</a>, <a class="iref" href="#rfc.xref.Part1.5">1.2.2</a>, <a class="iref" href="#rfc.xref.Part1.6">3.1</a>, <a class="iref" href="#rfc.xref.Part1.7">3.1</a>, <a class="iref" href="#rfc.xref.Part1.8">8</a>, <a class="iref" href="#Part1"><b>10.1</b></a><ul class="ind">
     1434                  <li class="indline1"><em>Part1</em>&nbsp;&nbsp;<a class="iref" href="#rfc.xref.Part1.1">1.2</a>, <a class="iref" href="#rfc.xref.Part1.2">1.2.1</a>, <a class="iref" href="#rfc.xref.Part1.3">1.2.1</a>, <a class="iref" href="#rfc.xref.Part1.4">1.2.1</a>, <a class="iref" href="#rfc.xref.Part1.5">1.2.2</a>, <a class="iref" href="#rfc.xref.Part1.6">2.1</a>, <a class="iref" href="#rfc.xref.Part1.7">3.1</a>, <a class="iref" href="#rfc.xref.Part1.8">3.1</a>, <a class="iref" href="#rfc.xref.Part1.9">8</a>, <a class="iref" href="#Part1"><b>10.1</b></a><ul class="ind">
    13911435                        <li class="indline1"><em>Section 1.2</em>&nbsp;&nbsp;<a class="iref" href="#rfc.xref.Part1.1">1.2</a></li>
    13921436                        <li class="indline1"><em>Section 1.2.2</em>&nbsp;&nbsp;<a class="iref" href="#rfc.xref.Part1.2">1.2.1</a>, <a class="iref" href="#rfc.xref.Part1.3">1.2.1</a>, <a class="iref" href="#rfc.xref.Part1.4">1.2.1</a></li>
    13931437                        <li class="indline1"><em>Section 6.1</em>&nbsp;&nbsp;<a class="iref" href="#rfc.xref.Part1.5">1.2.2</a></li>
    1394                         <li class="indline1"><em>Section 9.3.1</em>&nbsp;&nbsp;<a class="iref" href="#rfc.xref.Part1.6">3.1</a></li>
    1395                         <li class="indline1"><em>Section 9.3</em>&nbsp;&nbsp;<a class="iref" href="#rfc.xref.Part1.7">3.1</a></li>
     1438                        <li class="indline1"><em>Section 6.2</em>&nbsp;&nbsp;<a class="iref" href="#rfc.xref.Part1.6">2.1</a></li>
     1439                        <li class="indline1"><em>Section 9.3.1</em>&nbsp;&nbsp;<a class="iref" href="#rfc.xref.Part1.7">3.1</a></li>
     1440                        <li class="indline1"><em>Section 9.3</em>&nbsp;&nbsp;<a class="iref" href="#rfc.xref.Part1.8">3.1</a></li>
     1441                     </ul>
     1442                  </li>
     1443                  <li class="indline1"><em>Part3</em>&nbsp;&nbsp;<a class="iref" href="#rfc.xref.Part3.1">2.1</a>, <a class="iref" href="#rfc.xref.Part3.2">2.1</a>, <a class="iref" href="#Part3"><b>10.1</b></a><ul class="ind">
     1444                        <li class="indline1"><em>Section 4</em>&nbsp;&nbsp;<a class="iref" href="#rfc.xref.Part3.1">2.1</a></li>
     1445                        <li class="indline1"><em>Section 5.3</em>&nbsp;&nbsp;<a class="iref" href="#rfc.xref.Part3.2">2.1</a></li>
    13961446                     </ul>
    13971447                  </li>
Note: See TracChangeset for help on using the changeset viewer.