source: draft-ietf-httpbis/latest/p5-range.xml @ 588

Last change on this file since 588 was 588, checked in by julian.reschke@…, 11 years ago

Update to latest version of rfc2629.xslt and bump up document dates.

  • Property svn:eol-style set to native
File size: 63.6 KB
Line 
1<?xml version="1.0" encoding="utf-8"?>
2<?xml-stylesheet type='text/xsl' href='../myxml2rfc.xslt'?>
3<!DOCTYPE rfc [
4  <!ENTITY MAY "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>MAY</bcp14>">
5  <!ENTITY MUST "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>MUST</bcp14>">
6  <!ENTITY MUST-NOT "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>MUST NOT</bcp14>">
7  <!ENTITY OPTIONAL "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>OPTIONAL</bcp14>">
8  <!ENTITY RECOMMENDED "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>RECOMMENDED</bcp14>">
9  <!ENTITY REQUIRED "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>REQUIRED</bcp14>">
10  <!ENTITY SHALL "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>SHALL</bcp14>">
11  <!ENTITY SHALL-NOT "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>SHALL NOT</bcp14>">
12  <!ENTITY SHOULD "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>SHOULD</bcp14>">
13  <!ENTITY SHOULD-NOT "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>SHOULD NOT</bcp14>">
14  <!ENTITY ID-VERSION "latest">
15  <!ENTITY ID-MONTH "June">
16  <!ENTITY ID-YEAR "2009">
17  <!ENTITY notation                   "<xref target='Part1' x:rel='#notation' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
18  <!ENTITY notation-abnf              "<xref target='Part1' x:rel='#notation.abnf' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
19  <!ENTITY basic-rules                "<xref target='Part1' x:rel='#basic.rules' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
20  <!ENTITY full-date                  "<xref target='Part1' x:rel='#date.time.formats.full.date' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
21  <!ENTITY messaging                  "<xref target='Part1' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
22  <!ENTITY entity-tags                "<xref target='Part4' x:rel='#entity.tags' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
23  <!ENTITY weak-and-strong-validators "<xref target='Part4' x:rel='#weak.and.strong.validators' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
24]>
25<?rfc toc="yes" ?>
26<?rfc symrefs="yes" ?>
27<?rfc sortrefs="yes" ?>
28<?rfc compact="yes"?>
29<?rfc subcompact="no" ?>
30<?rfc linkmailto="no" ?>
31<?rfc editing="no" ?>
32<?rfc comments="yes"?>
33<?rfc inline="yes"?>
34<?rfc-ext allow-markup-in-artwork="yes" ?>
35<?rfc-ext include-references-in-index="yes" ?>
36<rfc obsoletes="2616" category="std" x:maturity-level="draft"
37     ipr="pre5378Trust200902" docName="draft-ietf-httpbis-p5-range-&ID-VERSION;"     xmlns:x='http://purl.org/net/xml2rfc/ext'>
38<front>
39
40  <title abbrev="HTTP/1.1, Part 5">HTTP/1.1, part 5: Range Requests and Partial Responses</title>
41
42  <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
43    <organization abbrev="Day Software">Day Software</organization>
44    <address>
45      <postal>
46        <street>23 Corporate Plaza DR, Suite 280</street>
47        <city>Newport Beach</city>
48        <region>CA</region>
49        <code>92660</code>
50        <country>USA</country>
51      </postal>
52      <phone>+1-949-706-5300</phone>
53      <facsimile>+1-949-706-5305</facsimile>
54      <email>fielding@gbiv.com</email>
55      <uri>http://roy.gbiv.com/</uri>
56    </address>
57  </author>
58
59  <author initials="J." surname="Gettys" fullname="Jim Gettys">
60    <organization>One Laptop per Child</organization>
61    <address>
62      <postal>
63        <street>21 Oak Knoll Road</street>
64        <city>Carlisle</city>
65        <region>MA</region>
66        <code>01741</code>
67        <country>USA</country>
68      </postal>
69      <email>jg@laptop.org</email>
70      <uri>http://www.laptop.org/</uri>
71    </address>
72  </author>
73 
74  <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
75    <organization abbrev="HP">Hewlett-Packard Company</organization>
76    <address>
77      <postal>
78        <street>HP Labs, Large Scale Systems Group</street>
79        <street>1501 Page Mill Road, MS 1177</street>
80        <city>Palo Alto</city>
81        <region>CA</region>
82        <code>94304</code>
83        <country>USA</country>
84      </postal>
85      <email>JeffMogul@acm.org</email>
86    </address>
87  </author>
88
89  <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
90    <organization abbrev="Microsoft">Microsoft Corporation</organization>
91    <address>
92      <postal>
93        <street>1 Microsoft Way</street>
94        <city>Redmond</city>
95        <region>WA</region>
96        <code>98052</code>
97        <country>USA</country>
98      </postal>
99      <email>henrikn@microsoft.com</email>
100    </address>
101  </author>
102
103  <author initials="L." surname="Masinter" fullname="Larry Masinter">
104    <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization>
105    <address>
106      <postal>
107        <street>345 Park Ave</street>
108        <city>San Jose</city>
109        <region>CA</region>
110        <code>95110</code>
111        <country>USA</country>
112      </postal>
113      <email>LMM@acm.org</email>
114      <uri>http://larry.masinter.net/</uri>
115    </address>
116  </author>
117 
118  <author initials="P." surname="Leach" fullname="Paul J. Leach">
119    <organization abbrev="Microsoft">Microsoft Corporation</organization>
120    <address>
121      <postal>
122        <street>1 Microsoft Way</street>
123        <city>Redmond</city>
124        <region>WA</region>
125        <code>98052</code>
126      </postal>
127      <email>paulle@microsoft.com</email>
128    </address>
129  </author>
130   
131  <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
132    <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
133    <address>
134      <postal>
135        <street>MIT Computer Science and Artificial Intelligence Laboratory</street>
136        <street>The Stata Center, Building 32</street>
137        <street>32 Vassar Street</street>
138        <city>Cambridge</city>
139        <region>MA</region>
140        <code>02139</code>
141        <country>USA</country>
142      </postal>
143      <email>timbl@w3.org</email>
144      <uri>http://www.w3.org/People/Berners-Lee/</uri>
145    </address>
146  </author>
147
148  <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
149    <organization abbrev="W3C">World Wide Web Consortium</organization>
150    <address>
151      <postal>
152        <street>W3C / ERCIM</street>
153        <street>2004, rte des Lucioles</street>
154        <city>Sophia-Antipolis</city>
155        <region>AM</region>
156        <code>06902</code>
157        <country>France</country>
158      </postal>
159      <email>ylafon@w3.org</email>
160      <uri>http://www.raubacapeu.net/people/yves/</uri>
161    </address>
162  </author>
163
164  <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
165    <organization abbrev="greenbytes">greenbytes GmbH</organization>
166    <address>
167      <postal>
168        <street>Hafenweg 16</street>
169        <city>Muenster</city><region>NW</region><code>48155</code>
170        <country>Germany</country>
171      </postal>
172      <phone>+49 251 2807760</phone>   
173      <facsimile>+49 251 2807761</facsimile>   
174      <email>julian.reschke@greenbytes.de</email>       
175      <uri>http://greenbytes.de/tech/webdav/</uri>     
176    </address>
177  </author>
178
179  <date month="&ID-MONTH;" year="&ID-YEAR;"/>
180  <workgroup>HTTPbis Working Group</workgroup>
181
182<abstract>
183<t>
184   The Hypertext Transfer Protocol (HTTP) is an application-level
185   protocol for distributed, collaborative, hypermedia information
186   systems. HTTP has been in use by the World Wide Web global information
187   initiative since 1990. This document is Part 5 of the seven-part specification
188   that defines the protocol referred to as "HTTP/1.1" and, taken together,
189   obsoletes RFC 2616.  Part 5 defines range-specific requests and
190   the rules for constructing and combining responses to those requests.
191</t>
192</abstract>
193
194<note title="Editorial Note (To be removed by RFC Editor)">
195  <t>
196    Discussion of this draft should take place on the HTTPBIS working group
197    mailing list (ietf-http-wg@w3.org). The current issues list is
198    at <eref target="http://tools.ietf.org/wg/httpbis/trac/report/11"/>
199    and related documents (including fancy diffs) can be found at
200    <eref target="http://tools.ietf.org/wg/httpbis/"/>.
201  </t>
202  <t>
203    The changes in this draft are summarized in <xref target="changes.since.06"/>.
204  </t>
205</note>
206</front>
207<middle>
208<section title="Introduction" anchor="introduction">
209<t>
210   HTTP clients often encounter interrupted data transfers as a result
211   of cancelled requests or dropped connections.  When a cache has stored
212   a partial representation, it is desirable to request the remainder
213   of that representation in a subsequent request rather than transfer
214   the entire representation.
215   There are also a number of Web applications that benefit from being
216   able to request only a subset of a larger representation, such as a
217   single page of a very large document or only part of an image to be
218   rendered by a device with limited local storage.
219</t>
220<t>
221   This document defines HTTP/1.1 range requests,
222   partial responses, and the multipart/byteranges media type.
223   The protocol for range requests is an &OPTIONAL; feature of HTTP,
224   designed so resources or recipients that do not implement this feature
225   can respond as if it is a normal GET request without impacting
226   interoperability.  Partial responses are indicated by a distinct status
227   code to not be mistaken for full responses by intermediate caches
228   that might not implement the feature.
229</t>
230<t>
231   Although the HTTP range request mechanism is designed to allow for
232   extensible range types, this specification only defines requests for
233   byte ranges.
234</t>
235
236<section title="Requirements" anchor="intro.requirements">
237<t>
238   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
239   "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
240   document are to be interpreted as described in <xref target="RFC2119"/>.
241</t>
242<t>
243   An implementation is not compliant if it fails to satisfy one or more
244   of the &MUST; or &REQUIRED; level requirements for the protocols it
245   implements. An implementation that satisfies all the &MUST; or &REQUIRED;
246   level and all the &SHOULD; level requirements for its protocols is said
247   to be "unconditionally compliant"; one that satisfies all the &MUST;
248   level requirements but not all the &SHOULD; level requirements for its
249   protocols is said to be "conditionally compliant."
250</t>
251</section>
252
253<section title="Syntax Notation" anchor="notation">
254  <x:anchor-alias value="ALPHA"/>
255  <x:anchor-alias value="CHAR"/>
256  <x:anchor-alias value="CR"/>
257  <x:anchor-alias value="DIGIT"/>
258  <x:anchor-alias value="LF"/>
259  <x:anchor-alias value="OCTET"/>
260  <x:anchor-alias value="SP"/>
261  <x:anchor-alias value="VCHAR"/>
262  <x:anchor-alias value="WSP"/>
263<t>
264  This specification uses the ABNF syntax defined in &notation; (which
265  extends the syntax defined in <xref target="RFC5234"/> with a list rule).
266  <xref target="collected.abnf"/> shows the collected ABNF, with the list
267  rule expanded.
268</t>
269<t>
270  The following core rules are included by
271  reference, as defined in <xref target="RFC5234" x:fmt="," x:sec="B.1"/>:
272  ALPHA (letters), CR (carriage return), CRLF (CR LF), CTL (controls),
273  DIGIT (decimal 0-9), DQUOTE (double quote),
274  HEXDIG (hexadecimal 0-9/A-F/a-f), LF (line feed),
275  OCTET (any 8-bit sequence of data), SP (space),
276  VCHAR (any visible USASCII character),
277  and WSP (whitespace).
278</t>
279
280<section title="Core Rules" anchor="core.rules">
281  <x:anchor-alias value="token"/>
282  <x:anchor-alias value="OWS"/>
283<t>
284  The core rules below are defined in &basic-rules;:
285</t>
286<figure><artwork type="abnf2616">
287  <x:ref>token</x:ref>      = &lt;token, defined in &basic-rules;&gt;
288  <x:ref>OWS</x:ref>        = &lt;OWS, defined in &basic-rules;&gt;
289</artwork></figure>
290</section>
291
292<section title="ABNF Rules defined in other Parts of the Specification" anchor="abnf.dependencies">
293  <x:anchor-alias value="entity-tag"/>
294  <x:anchor-alias value="HTTP-date"/>
295<t>
296  The ABNF rules below are defined in other parts:
297</t>
298<figure><!--Part1--><artwork type="abnf2616">
299  <x:ref>HTTP-date</x:ref>  = &lt;HTTP-date, defined in &full-date;&gt;
300</artwork></figure>
301<figure><!--Part4--><artwork type="abnf2616">
302  <x:ref>entity-tag</x:ref> = &lt;entity-tag, defined in &entity-tags;&gt;
303</artwork></figure>
304</section>
305
306</section>
307
308</section>
309
310
311<section title="Range Units" anchor="range.units">
312  <x:anchor-alias value="bytes-unit"/>
313  <x:anchor-alias value="other-range-unit"/>
314  <x:anchor-alias value="range-unit"/>
315<t>
316   HTTP/1.1 allows a client to request that only part (a range of) the
317   response entity be included within the response. HTTP/1.1 uses range
318   units in the Range (<xref target="header.range"/>) and Content-Range (<xref target="header.content-range"/>)
319   header fields. An entity can be broken down into subranges according
320   to various structural units.
321</t>
322<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="range-unit"/><iref primary="true" item="Grammar" subitem="bytes-unit"/><iref primary="true" item="Grammar" subitem="other-range-unit"/>
323  <x:ref>range-unit</x:ref>       = <x:ref>bytes-unit</x:ref> / <x:ref>other-range-unit</x:ref>
324  <x:ref>bytes-unit</x:ref>       = "bytes"
325  <x:ref>other-range-unit</x:ref> = <x:ref>token</x:ref>
326</artwork></figure>
327<t>
328  HTTP/1.1 has been designed to allow implementations of applications
329  that do not depend on knowledge of ranges. The only range unit defined
330  by HTTP/1.1 is "bytes".
331</t>
332<t>
333  If a range unit is not understood in a request, a server &MUST; ignore
334  the whole Range header (<xref target="header.range" />).
335  If a range unit is not understood in a response, an intermediary
336  &SHOULD; pass the response to the client; a client &MUST; fail.
337</t>
338</section>
339
340<section title="Status Code Definitions">
341<section title="206 Partial Content" anchor="status.206">
342  <iref primary="true" item="206 Partial Content (status code)" x:for-anchor=""/>
343  <iref primary="true" item="Status Codes" subitem="206 Partial Content" x:for-anchor=""/>
344<t>
345   The server has fulfilled the partial GET request for the resource.
346   The request &MUST; have included a Range header field (<xref target="header.range"/>)
347   indicating the desired range, and &MAY; have included an If-Range
348   header field (<xref target="header.if-range"/>) to make the request conditional.
349</t>
350<t>
351   The response &MUST; include the following header fields:
352  <list style="symbols">
353    <t>
354        Either a Content-Range header field (<xref target="header.content-range"/>) indicating
355        the range included with this response, or a multipart/byteranges
356        Content-Type including Content-Range fields for each part. If a
357        Content-Length header field is present in the response, its
358        value &MUST; match the actual number of OCTETs transmitted in the
359        message-body.
360    </t>
361    <t>
362        Date
363    </t>
364    <t>
365        ETag and/or Content-Location, if the header would have been sent
366        in a 200 response to the same request
367    </t>
368    <t>
369        Expires, Cache-Control, and/or Vary, if the field-value might
370        differ from that sent in any previous response for the same
371        variant
372    </t>
373  </list>
374</t>
375<t>
376   If the 206 response is the result of an If-Range request, the response
377   &SHOULD-NOT; include other entity-headers. Otherwise, the response
378   &MUST; include all of the entity-headers that would have been returned
379   with a 200 (OK) response to the same request.
380</t>
381<t>
382   A cache &MUST-NOT; combine a 206 response with other previously cached
383   content if the ETag or Last-Modified headers do not match exactly,
384   see <xref target="combining.byte.ranges"/>.
385</t>
386<t>
387   A cache that does not support the Range and Content-Range headers
388   &MUST-NOT; cache 206 (Partial Content) responses. Furthermore,
389   if a response uses a range unit that is not understood by the cache,
390   then it &MUST-NOT; be cached either.
391</t>
392</section>
393
394<section title="416 Requested Range Not Satisfiable" anchor="status.416">
395  <iref primary="true" item="416 Requested Range Not Satisfiable (status code)" x:for-anchor=""/>
396  <iref primary="true" item="Status Codes" subitem="416 Requested Range Not Satisfiable" x:for-anchor=""/>
397<t>
398   A server &SHOULD; return a response with this status code if a request
399   included a Range request-header field (<xref target="header.range"/>), and none of
400   the ranges-specifier values in this field overlap the current extent
401   of the selected resource, and the request did not include an If-Range
402   request-header field. (For byte-ranges, this means that the first-byte-pos
403   of all of the byte-range-spec values were greater than the
404   current length of the selected resource.)
405</t>
406<t>
407   When this status code is returned for a byte-range request, the
408   response &SHOULD; include a Content-Range entity-header field
409   specifying the current length of the selected resource (see <xref target="header.content-range"/>).
410   This response &MUST-NOT; use the multipart/byteranges content-type.
411</t>
412</section>
413</section>
414
415<section title="Combining Ranges" anchor="combining.byte.ranges">
416<t>
417   A response might transfer only a subrange of an entity-body, either
418   the request included one or more Range specifications, or because
419   a connection was broken prematurely.
420   After several such transfers, a cache might have received several
421   ranges of the same entity-body.
422</t>
423<t>
424   If a cache has a stored non-empty set of subranges for an entity, and
425   an incoming response transfers another subrange, the cache &MAY;
426   combine the new subrange with the existing set if both the following
427   conditions are met:
428  <list style="symbols">
429    <t>Both the incoming response and the cache entry have a cache
430        validator.</t>
431    <t>The two cache validators match using the strong comparison
432        function (see &weak-and-strong-validators;).</t>
433  </list>
434</t>
435<t>
436   If either requirement is not met, the cache &MUST; use only the most
437   recent partial response (based on the Date values transmitted with
438   every response, and using the incoming response if these values are
439   equal or missing), and &MUST; discard the other partial information.
440</t>
441</section>
442
443<section title="Header Field Definitions" anchor="header.fields">
444<t>
445   This section defines the syntax and semantics of HTTP/1.1 header fields
446   related to range requests and partial responses.
447</t>
448<t>
449   For entity-header fields, both sender and recipient refer to either the
450   client or the server, depending on who sends and who receives the entity.
451</t>
452
453<section title="Accept-Ranges" anchor="header.accept-ranges">
454  <iref primary="true" item="Accept-Ranges header" x:for-anchor=""/>
455  <iref primary="true" item="Headers" subitem="Accept-Ranges" x:for-anchor=""/>
456  <x:anchor-alias value="Accept-Ranges"/>
457  <x:anchor-alias value="Accept-Ranges-v"/>
458  <x:anchor-alias value="acceptable-ranges"/>
459<t>
460      The response-header "Accept-Ranges" field allows the server to
461      indicate its acceptance of range requests for a resource:
462</t>
463<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Accept-Ranges"/><iref primary="true" item="Grammar" subitem="Accept-Ranges-v"/><iref primary="true" item="Grammar" subitem="acceptable-ranges"/>
464  <x:ref>Accept-Ranges</x:ref>     = "Accept-Ranges" ":" <x:ref>OWS</x:ref> <x:ref>Accept-Ranges-v</x:ref>
465  <x:ref>Accept-Ranges-v</x:ref>   = <x:ref>acceptable-ranges</x:ref>
466  <x:ref>acceptable-ranges</x:ref> = 1#<x:ref>range-unit</x:ref> / "none"
467</artwork></figure>
468<t>
469      Origin servers that accept byte-range requests &MAY; send
470</t>
471<figure><artwork type="example">
472  Accept-Ranges: bytes
473</artwork></figure>
474<t>
475      but are not required to do so. Clients &MAY; generate range
476      requests without having received this header for the resource
477      involved. Range units are defined in <xref target="range.units"/>.
478</t>
479<t>
480      Servers that do not accept any kind of range request for a
481      resource &MAY; send
482</t>
483<figure><artwork type="example">
484  Accept-Ranges: none
485</artwork></figure>
486<t>
487      to advise the client not to attempt a range request.
488</t>
489</section>
490
491<section title="Content-Range" anchor="header.content-range">
492  <iref primary="true" item="Content-Range header" x:for-anchor=""/>
493  <iref primary="true" item="Headers" subitem="Content-Range" x:for-anchor=""/>
494  <x:anchor-alias value="byte-content-range-spec"/>
495  <x:anchor-alias value="byte-range-resp-spec"/>
496  <x:anchor-alias value="Content-Range"/>
497  <x:anchor-alias value="Content-Range-v"/>
498  <x:anchor-alias value="content-range-spec"/>
499  <x:anchor-alias value="instance-length"/>
500  <x:anchor-alias value="other-content-range-spec"/>
501  <x:anchor-alias value="other-range-resp-spec"/>
502<t>
503   The entity-header "Content-Range" is sent with a partial entity-body to
504   specify where in the full entity-body the partial body should be
505   applied. Range units are defined in <xref target="range.units"/>.
506</t>
507<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Content-Range"/><iref primary="true" item="Grammar" subitem="Content-Range-v"/><iref primary="true" item="Grammar" subitem="content-range-spec"/><iref primary="true" item="Grammar" subitem="byte-content-range-spec"/><iref primary="true" item="Grammar" subitem="byte-range-resp-spec"/><iref primary="true" item="Grammar" subitem="instance-length"/>
508  <x:ref>Content-Range</x:ref> = "Content-Range" ":" <x:ref>OWS</x:ref> <x:ref>Content-Range-v</x:ref>
509  <x:ref>Content-Range-v</x:ref> = <x:ref>content-range-spec</x:ref>
510 
511  <x:ref>content-range-spec</x:ref>      = <x:ref>byte-content-range-spec</x:ref>
512                          / <x:ref>other-content-range-spec</x:ref>
513  <x:ref>byte-content-range-spec</x:ref> = <x:ref>bytes-unit</x:ref> <x:ref>SP</x:ref>
514                            <x:ref>byte-range-resp-spec</x:ref> "/"
515                            ( <x:ref>instance-length</x:ref> / "*" )
516 
517  <x:ref>byte-range-resp-spec</x:ref>    = (<x:ref>first-byte-pos</x:ref> "-" <x:ref>last-byte-pos</x:ref>)
518                          / "*"
519                         
520  <x:ref>instance-length</x:ref>         = 1*<x:ref>DIGIT</x:ref>
521 
522  <x:ref>other-content-range-spec</x:ref> = <x:ref>other-range-unit</x:ref> <x:ref>SP</x:ref>
523                             <x:ref>other-range-resp-spec</x:ref>
524  <x:ref>other-range-resp-spec</x:ref>    = *<x:ref>CHAR</x:ref>
525</artwork></figure>
526<t>
527   The header &SHOULD; indicate the total length of the full entity-body,
528   unless this length is unknown or difficult to determine. The asterisk
529   "*" character means that the instance-length is unknown at the time
530   when the response was generated.
531</t>
532<t>
533   Unlike byte-ranges-specifier values (see <xref target="byte.ranges"/>), a byte-range-resp-spec
534   &MUST; only specify one range, and &MUST; contain
535   absolute byte positions for both the first and last byte of the
536   range.
537</t>
538<t>
539   A byte-content-range-spec with a byte-range-resp-spec whose last-byte-pos
540   value is less than its first-byte-pos value, or whose
541   instance-length value is less than or equal to its last-byte-pos
542   value, is invalid. The recipient of an invalid byte-content-range-spec
543   &MUST; ignore it and any content transferred along with it.
544</t>
545<t>
546   In the case of a byte range request:
547   A server sending a response with status code 416 (Requested range not
548   satisfiable) &SHOULD; include a Content-Range field with a byte-range-resp-spec
549   of "*". The instance-length specifies the current length of
550   the selected resource. A response with status code 206 (Partial
551   Content) &MUST-NOT; include a Content-Range field with a byte-range-resp-spec of "*".
552</t>
553<t>
554   Examples of byte-content-range-spec values, assuming that the entity
555   contains a total of 1234 bytes:
556   <list style="symbols">
557      <t>
558        The first 500 bytes:
559<figure><artwork type="example" x:indent-with="   ">
560  bytes 0-499/1234
561</artwork></figure>
562      </t>   
563      <t>
564        The second 500 bytes:
565<figure><artwork type="example" x:indent-with="   ">
566  bytes 500-999/1234
567</artwork></figure>
568      </t>   
569      <t>
570        All except for the first 500 bytes:
571<figure><artwork type="example" x:indent-with="   ">
572  bytes 500-1233/1234
573</artwork></figure>
574      </t>   
575      <t>
576        The last 500 bytes:
577<figure><artwork type="example" x:indent-with="   ">
578  bytes 734-1233/1234
579</artwork></figure>
580      </t>   
581   </list>
582</t>
583<t>
584   When an HTTP message includes the content of a single range (for
585   example, a response to a request for a single range, or to a request
586   for a set of ranges that overlap without any holes), this content is
587   transmitted with a Content-Range header, and a Content-Length header
588   showing the number of bytes actually transferred. For example,
589</t>
590<figure><artwork type="example">
591  HTTP/1.1 206 Partial Content
592  Date: Wed, 15 Nov 1995 06:25:24 GMT
593  Last-Modified: Wed, 15 Nov 1995 04:58:08 GMT
594  Content-Range: bytes 21010-47021/47022
595  Content-Length: 26012
596  Content-Type: image/gif
597</artwork></figure>
598<t>
599   When an HTTP message includes the content of multiple ranges (for
600   example, a response to a request for multiple non-overlapping
601   ranges), these are transmitted as a multipart message. The multipart
602   media type used for this purpose is "multipart/byteranges" as defined
603   in <xref target="internet.media.type.multipart.byteranges"/>. See <xref target="changes.from.rfc.2068"/> for a compatibility issue.
604</t>
605<t>
606   A response to a request for a single range &MUST-NOT; be sent using the
607   multipart/byteranges media type.  A response to a request for
608   multiple ranges, whose result is a single range, &MAY; be sent as a
609   multipart/byteranges media type with one part. A client that cannot
610   decode a multipart/byteranges message &MUST-NOT; ask for multiple
611   ranges in a single request.
612</t>
613<t>
614   When a client requests multiple byte-ranges in one request, the
615   server &SHOULD; return them in the order that they appeared in the
616   request.
617</t>
618<t>
619   If the server ignores a byte-range-spec because it is syntactically
620   invalid, the server &SHOULD; treat the request as if the invalid Range
621   header field did not exist. (Normally, this means return a 200
622   response containing the full entity).
623</t>
624<t>
625   If the server receives a request (other than one including an If-Range
626   request-header field) with an unsatisfiable Range request-header
627   field (that is, all of whose byte-range-spec values have a
628   first-byte-pos value greater than the current length of the selected
629   resource), it &SHOULD; return a response code of 416 (Requested range
630   not satisfiable) (<xref target="status.416"/>).
631</t>
632<x:note>
633  <t>
634    <x:h>Note:</x:h> clients cannot depend on servers to send a 416 (Requested
635    range not satisfiable) response instead of a 200 (OK) response for
636    an unsatisfiable Range request-header, since not all servers
637    implement this request-header.
638  </t>
639</x:note>
640</section>
641
642<section title="If-Range" anchor="header.if-range">
643  <iref primary="true" item="If-Range header" x:for-anchor=""/>
644  <iref primary="true" item="Headers" subitem="If-Range" x:for-anchor=""/>
645  <x:anchor-alias value="If-Range"/>
646  <x:anchor-alias value="If-Range-v"/>
647<t>
648   If a client has a partial copy of an entity in its cache, and wishes
649   to have an up-to-date copy of the entire entity in its cache, it
650   could use the Range request-header with a conditional GET (using
651   either or both of If-Unmodified-Since and If-Match.) However, if the
652   condition fails because the entity has been modified, the client
653   would then have to make a second request to obtain the entire current
654   entity-body.
655</t>
656<t>
657   The request header "If-Range" allows a client to "short-circuit" the second
658   request. Informally, its meaning is `if the entity is unchanged, send
659   me the part(s) that I am missing; otherwise, send me the entire new
660   entity'.
661</t>
662<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="If-Range"/><iref primary="true" item="Grammar" subitem="If-Range-v"/>
663  <x:ref>If-Range</x:ref>   = "If-Range" ":" <x:ref>OWS</x:ref> <x:ref>If-Range-v</x:ref>
664  <x:ref>If-Range-v</x:ref> = <x:ref>entity-tag</x:ref> / <x:ref>HTTP-date</x:ref>
665</artwork></figure>
666<t>
667   If the client has no entity tag for an entity, but does have a Last-Modified
668   date, it &MAY; use that date in an If-Range header. (The
669   server can distinguish between a valid HTTP-date and any form of
670   entity-tag by examining no more than two characters.) The If-Range
671   header &SHOULD; only be used together with a Range header, and &MUST; be
672   ignored if the request does not include a Range header, or if the
673   server does not support the sub-range operation.
674</t>
675<t>
676   If the entity tag given in the If-Range header matches the current
677   entity tag for the entity, then the server &SHOULD; provide the
678   specified sub-range of the entity using a 206 (Partial Content)
679   response. If the entity tag does not match, then the server &SHOULD;
680   return the entire entity using a 200 (OK) response.
681</t>
682</section>
683
684<section title="Range" anchor="header.range">
685  <iref primary="true" item="Range header" x:for-anchor=""/>
686  <iref primary="true" item="Headers" subitem="Range" x:for-anchor=""/>
687
688<section title="Byte Ranges" anchor="byte.ranges">
689<t>
690   Since all HTTP entities are represented in HTTP messages as sequences
691   of bytes, the concept of a byte range is meaningful for any HTTP
692   entity. (However, not all clients and servers need to support byte-range
693   operations.)
694</t>
695<t>
696   Byte range specifications in HTTP apply to the sequence of bytes in
697   the entity-body (not necessarily the same as the message-body).
698</t>
699<t anchor="rule.ranges-specifier">
700  <x:anchor-alias value="byte-range-set"/>
701  <x:anchor-alias value="byte-range-spec"/>
702  <x:anchor-alias value="byte-ranges-specifier"/>
703  <x:anchor-alias value="first-byte-pos"/>
704  <x:anchor-alias value="last-byte-pos"/>
705  <x:anchor-alias value="ranges-specifier"/>
706  <x:anchor-alias value="suffix-byte-range-spec"/>
707  <x:anchor-alias value="suffix-length"/>
708
709   A byte range operation &MAY; specify a single range of bytes, or a set
710   of ranges within a single entity.
711</t>
712<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="ranges-specifier"/><iref primary="true" item="Grammar" subitem="byte-ranges-specifier"/><iref primary="true" item="Grammar" subitem="byte-range-set"/><iref primary="true" item="Grammar" subitem="byte-range-spec"/><iref primary="true" item="Grammar" subitem="first-byte-pos"/><iref primary="true" item="Grammar" subitem="last-byte-pos"/>
713  <x:ref>byte-ranges-specifier</x:ref> = <x:ref>bytes-unit</x:ref> "=" <x:ref>byte-range-set</x:ref>
714  <x:ref>byte-range-set</x:ref>  = 1#( <x:ref>byte-range-spec</x:ref> / <x:ref>suffix-byte-range-spec</x:ref> )
715  <x:ref>byte-range-spec</x:ref> = <x:ref>first-byte-pos</x:ref> "-" [ <x:ref>last-byte-pos</x:ref> ]
716  <x:ref>first-byte-pos</x:ref>  = 1*<x:ref>DIGIT</x:ref>
717  <x:ref>last-byte-pos</x:ref>   = 1*<x:ref>DIGIT</x:ref>
718</artwork></figure>
719<t>
720   The first-byte-pos value in a byte-range-spec gives the byte-offset
721   of the first byte in a range. The last-byte-pos value gives the
722   byte-offset of the last byte in the range; that is, the byte
723   positions specified are inclusive. Byte offsets start at zero.
724</t>
725<t>
726   If the last-byte-pos value is present, it &MUST; be greater than or
727   equal to the first-byte-pos in that byte-range-spec, or the byte-range-spec
728   is syntactically invalid. The recipient of a byte-range-set
729   that includes one or more syntactically invalid byte-range-spec
730   values &MUST; ignore the header field that includes that byte-range-set.
731</t>
732<t>
733   If the last-byte-pos value is absent, or if the value is greater than
734   or equal to the current length of the entity-body, last-byte-pos is
735   taken to be equal to one less than the current length of the entity-body
736   in bytes.
737</t>
738<t>
739   By its choice of last-byte-pos, a client can limit the number of
740   bytes retrieved without knowing the size of the entity.
741</t>
742<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="suffix-byte-range-spec"/><iref primary="true" item="Grammar" subitem="suffix-length"/>
743  <x:ref>suffix-byte-range-spec</x:ref> = "-" <x:ref>suffix-length</x:ref>
744  <x:ref>suffix-length</x:ref> = 1*<x:ref>DIGIT</x:ref>
745</artwork></figure>
746<t>
747   A suffix-byte-range-spec is used to specify the suffix of the
748   entity-body, of a length given by the suffix-length value. (That is,
749   this form specifies the last N bytes of an entity-body.) If the
750   entity is shorter than the specified suffix-length, the entire
751   entity-body is used.
752</t>
753<t>
754   If a syntactically valid byte-range-set includes at least one byte-range-spec
755   whose first-byte-pos is less than the current length of
756   the entity-body, or at least one suffix-byte-range-spec with a non-zero
757   suffix-length, then the byte-range-set is satisfiable.
758   Otherwise, the byte-range-set is unsatisfiable. If the byte-range-set
759   is unsatisfiable, the server &SHOULD; return a response with a status
760   of 416 (Requested range not satisfiable). Otherwise, the server
761   &SHOULD; return a response with a status of 206 (Partial Content)
762   containing the satisfiable ranges of the entity-body.
763</t>
764<t>
765   Examples of byte-ranges-specifier values (assuming an entity-body of
766   length 10000):
767  <list style="symbols">
768     <t>The first 500 bytes (byte offsets 0-499, inclusive):
769<figure><artwork type="example" x:indent-with="   ">
770  bytes=0-499
771</artwork></figure>
772    </t>
773     <t>The second 500 bytes (byte offsets 500-999, inclusive):
774<figure><artwork type="example" x:indent-with="   ">
775  bytes=500-999
776</artwork></figure>
777    </t>
778     <t>The final 500 bytes (byte offsets 9500-9999, inclusive):
779<figure><artwork type="example" x:indent-with="   ">
780  bytes=-500
781</artwork></figure>
782    Or:
783<figure><artwork type="example" x:indent-with="   ">
784  bytes=9500-
785</artwork></figure>
786    </t>
787     <t>The first and last bytes only (bytes 0 and 9999):
788<figure><artwork type="example" x:indent-with="   ">
789  bytes=0-0,-1
790</artwork></figure>
791     </t>
792     <t>Several legal but not canonical specifications of the second 500
793        bytes (byte offsets 500-999, inclusive):
794<figure><artwork type="example" x:indent-with="   ">
795  bytes=500-600,601-999
796  bytes=500-700,601-999
797</artwork></figure>
798     </t>
799  </list>
800</t>
801</section>
802
803<section title="Range Retrieval Requests" anchor="range.retrieval.requests">
804  <x:anchor-alias value="Range"/>
805  <x:anchor-alias value="Range-v"/>
806  <x:anchor-alias value="other-ranges-specifier"/>
807<t>
808   HTTP retrieval requests using conditional or unconditional GET
809   methods &MAY; request one or more sub-ranges of the entity, instead of
810   the entire entity, using the Range request header, which applies to
811   the entity returned as the result of the request:
812</t>
813<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Range"/>
814  <x:ref>Range</x:ref>   = "Range" ":" <x:ref>OWS</x:ref> <x:ref>Range-v</x:ref>
815  <x:ref>Range-v</x:ref> = <x:ref>byte-ranges-specifier</x:ref>
816          / <x:ref>other-ranges-specifier</x:ref>
817  <x:ref>other-ranges-specifier</x:ref> = 1*<x:ref>CHAR</x:ref>
818</artwork></figure>
819<t>
820   A server &MAY; ignore the Range header. However, HTTP/1.1 origin
821   servers and intermediate caches ought to support byte ranges when
822   possible, since Range supports efficient recovery from partially
823   failed transfers, and supports efficient partial retrieval of large
824   entities.
825</t>
826<t>
827   If the server supports the Range header and the specified range or
828   ranges are appropriate for the entity:
829  <list style="symbols">
830     <t>The presence of a Range header in an unconditional GET modifies
831        what is returned if the GET is otherwise successful. In other
832        words, the response carries a status code of 206 (Partial
833        Content) instead of 200 (OK).</t>
834
835     <t>The presence of a Range header in a conditional GET (a request
836        using one or both of If-Modified-Since and If-None-Match, or
837        one or both of If-Unmodified-Since and If-Match) modifies what
838        is returned if the GET is otherwise successful and the
839        condition is true. It does not affect the 304 (Not Modified)
840        response returned if the conditional is false.</t>
841  </list>
842</t>
843<t>
844   In some cases, it might be more appropriate to use the If-Range
845   header (see <xref target="header.if-range"/>) in addition to the Range header.
846</t>
847<t>
848   If a proxy that supports ranges receives a Range request, forwards
849   the request to an inbound server, and receives an entire entity in
850   reply, it &SHOULD; only return the requested range to its client. It
851   &SHOULD; store the entire received response in its cache if that is
852   consistent with its cache allocation policies.
853</t>
854</section>
855</section>
856</section>
857
858<section title="IANA Considerations" anchor="IANA.considerations">
859<section title="Message Header Registration" anchor="message.header.registration">
860<t>
861   The Message Header Registry located at <eref target="http://www.iana.org/assignments/message-headers/message-header-index.html"/> should be updated
862   with the permanent registrations below (see <xref target="RFC3864"/>):
863</t>
864<!--AUTOGENERATED FROM extract-header-defs.xslt, do not edit manually-->
865<texttable align="left" suppress-title="true" anchor="iana.header.registration.table">
866   <ttcol>Header Field Name</ttcol>
867   <ttcol>Protocol</ttcol>
868   <ttcol>Status</ttcol>
869   <ttcol>Reference</ttcol>
870
871   <c>Accept-Ranges</c>
872   <c>http</c>
873   <c>standard</c>
874   <c>
875      <xref target="header.accept-ranges"/>
876   </c>
877   <c>Content-Range</c>
878   <c>http</c>
879   <c>standard</c>
880   <c>
881      <xref target="header.content-range"/>
882   </c>
883   <c>If-Range</c>
884   <c>http</c>
885   <c>standard</c>
886   <c>
887      <xref target="header.if-range"/>
888   </c>
889   <c>Range</c>
890   <c>http</c>
891   <c>standard</c>
892   <c>
893      <xref target="header.range"/>
894   </c>
895</texttable>
896<!--(END)-->
897<t>
898   The change controller is: "IETF (iesg@ietf.org) - Internet Engineering Task Force".
899</t>
900</section>
901</section>
902
903<section title="Security Considerations" anchor="security.considerations">
904<t>
905   No additional security considerations have been identified beyond
906   those applicable to HTTP in general &messaging;.
907</t>
908</section>
909
910<section title="Acknowledgments" anchor="ack">
911<t>
912   Most of the specification of ranges is based on work originally done
913   by Ari Luotonen and John Franks, with additional input from Steve
914   Zilles, Daniel W. Connolly, Roy T. Fielding, Jim Gettys, Martin Hamilton,
915   Koen Holtman, Shel Kaplan, Paul Leach, Alex Lopez-Ortiz, Larry Masinter,
916   Jeff Mogul, Lou Montulli, David W. Morris, Luigi Rizzo, and Bill Weihl.
917</t>
918</section>
919</middle>
920<back>
921
922<references title="Normative References">
923
924<reference anchor="Part1">
925  <front>
926    <title abbrev="HTTP/1.1">HTTP/1.1, part 1: URIs, Connections, and Message Parsing</title>
927    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
928      <organization abbrev="Day Software">Day Software</organization>
929      <address><email>fielding@gbiv.com</email></address>
930    </author>
931    <author initials="J." surname="Gettys" fullname="Jim Gettys">
932      <organization>One Laptop per Child</organization>
933      <address><email>jg@laptop.org</email></address>
934    </author>
935    <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
936      <organization abbrev="HP">Hewlett-Packard Company</organization>
937      <address><email>JeffMogul@acm.org</email></address>
938    </author>
939    <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
940      <organization abbrev="Microsoft">Microsoft Corporation</organization>
941      <address><email>henrikn@microsoft.com</email></address>
942    </author>
943    <author initials="L." surname="Masinter" fullname="Larry Masinter">
944      <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization>
945      <address><email>LMM@acm.org</email></address>
946    </author>
947    <author initials="P." surname="Leach" fullname="Paul J. Leach">
948      <organization abbrev="Microsoft">Microsoft Corporation</organization>
949      <address><email>paulle@microsoft.com</email></address>
950    </author>
951    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
952      <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
953      <address><email>timbl@w3.org</email></address>
954    </author>
955    <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
956      <organization abbrev="W3C">World Wide Web Consortium</organization>
957      <address><email>ylafon@w3.org</email></address>
958    </author>
959    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
960      <organization abbrev="greenbytes">greenbytes GmbH</organization>
961      <address><email>julian.reschke@greenbytes.de</email></address>
962    </author>
963    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
964  </front>
965  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p1-messaging-&ID-VERSION;"/>
966  <x:source href="p1-messaging.xml" basename="p1-messaging"/>
967</reference>
968
969<reference anchor="Part3">
970  <front>
971    <title abbrev="HTTP/1.1">HTTP/1.1, part 3: Message Payload and Content Negotiation</title>
972    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
973      <organization abbrev="Day Software">Day Software</organization>
974      <address><email>fielding@gbiv.com</email></address>
975    </author>
976    <author initials="J." surname="Gettys" fullname="Jim Gettys">
977      <organization>One Laptop per Child</organization>
978      <address><email>jg@laptop.org</email></address>
979    </author>
980    <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
981      <organization abbrev="HP">Hewlett-Packard Company</organization>
982      <address><email>JeffMogul@acm.org</email></address>
983    </author>
984    <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
985      <organization abbrev="Microsoft">Microsoft Corporation</organization>
986      <address><email>henrikn@microsoft.com</email></address>
987    </author>
988    <author initials="L." surname="Masinter" fullname="Larry Masinter">
989      <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization>
990      <address><email>LMM@acm.org</email></address>
991    </author>
992    <author initials="P." surname="Leach" fullname="Paul J. Leach">
993      <organization abbrev="Microsoft">Microsoft Corporation</organization>
994      <address><email>paulle@microsoft.com</email></address>
995    </author>
996    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
997      <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
998      <address><email>timbl@w3.org</email></address>
999    </author>
1000    <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
1001      <organization abbrev="W3C">World Wide Web Consortium</organization>
1002      <address><email>ylafon@w3.org</email></address>
1003    </author>
1004    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
1005      <organization abbrev="greenbytes">greenbytes GmbH</organization>
1006      <address><email>julian.reschke@greenbytes.de</email></address>
1007    </author>
1008    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
1009  </front>
1010  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p3-payload-&ID-VERSION;"/>
1011  <x:source href="p3-payload.xml" basename="p3-payload"/>
1012</reference>
1013
1014<reference anchor="Part4">
1015  <front>
1016    <title abbrev="HTTP/1.1">HTTP/1.1, part 4: Conditional Requests</title>
1017    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
1018      <organization abbrev="Day Software">Day Software</organization>
1019      <address><email>fielding@gbiv.com</email></address>
1020    </author>
1021    <author initials="J." surname="Gettys" fullname="Jim Gettys">
1022      <organization>One Laptop per Child</organization>
1023      <address><email>jg@laptop.org</email></address>
1024    </author>
1025    <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
1026      <organization abbrev="HP">Hewlett-Packard Company</organization>
1027      <address><email>JeffMogul@acm.org</email></address>
1028    </author>
1029    <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
1030      <organization abbrev="Microsoft">Microsoft Corporation</organization>
1031      <address><email>henrikn@microsoft.com</email></address>
1032    </author>
1033    <author initials="L." surname="Masinter" fullname="Larry Masinter">
1034      <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization>
1035      <address><email>LMM@acm.org</email></address>
1036    </author>
1037    <author initials="P." surname="Leach" fullname="Paul J. Leach">
1038      <organization abbrev="Microsoft">Microsoft Corporation</organization>
1039      <address><email>paulle@microsoft.com</email></address>
1040    </author>
1041    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
1042      <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
1043      <address><email>timbl@w3.org</email></address>
1044    </author>
1045    <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
1046      <organization abbrev="W3C">World Wide Web Consortium</organization>
1047      <address><email>ylafon@w3.org</email></address>
1048    </author>
1049    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
1050      <organization abbrev="greenbytes">greenbytes GmbH</organization>
1051      <address><email>julian.reschke@greenbytes.de</email></address>
1052    </author>
1053    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
1054  </front>
1055  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p4-conditional-&ID-VERSION;"/>
1056  <x:source href="p4-conditional.xml" basename="p4-conditional"/>
1057</reference>
1058
1059<reference anchor="Part6">
1060  <front>
1061    <title abbrev="HTTP/1.1">HTTP/1.1, part 6: Caching</title>
1062    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
1063      <organization abbrev="Day Software">Day Software</organization>
1064      <address><email>fielding@gbiv.com</email></address>
1065    </author>
1066    <author initials="J." surname="Gettys" fullname="Jim Gettys">
1067      <organization>One Laptop per Child</organization>
1068      <address><email>jg@laptop.org</email></address>
1069    </author>
1070    <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
1071      <organization abbrev="HP">Hewlett-Packard Company</organization>
1072      <address><email>JeffMogul@acm.org</email></address>
1073    </author>
1074    <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
1075      <organization abbrev="Microsoft">Microsoft Corporation</organization>
1076      <address><email>henrikn@microsoft.com</email></address>
1077    </author>
1078    <author initials="L." surname="Masinter" fullname="Larry Masinter">
1079      <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization>
1080      <address><email>LMM@acm.org</email></address>
1081    </author>
1082    <author initials="P." surname="Leach" fullname="Paul J. Leach">
1083      <organization abbrev="Microsoft">Microsoft Corporation</organization>
1084      <address><email>paulle@microsoft.com</email></address>
1085    </author>
1086    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
1087      <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
1088      <address><email>timbl@w3.org</email></address>
1089    </author>
1090    <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
1091      <organization abbrev="W3C">World Wide Web Consortium</organization>
1092      <address><email>ylafon@w3.org</email></address>
1093    </author>
1094    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
1095      <organization abbrev="greenbytes">greenbytes GmbH</organization>
1096      <address><email>julian.reschke@greenbytes.de</email></address>
1097    </author>
1098    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
1099  </front>
1100  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p6-cache-&ID-VERSION;"/>
1101  <x:source href="p6-cache.xml" basename="p6-cache"/>
1102</reference>
1103
1104<reference anchor="RFC2046">
1105  <front>
1106    <title abbrev="Media Types">Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types</title>
1107    <author initials="N." surname="Freed" fullname="Ned Freed">
1108      <organization>Innosoft International, Inc.</organization>
1109      <address><email>ned@innosoft.com</email></address>
1110    </author>
1111    <author initials="N." surname="Borenstein" fullname="Nathaniel S. Borenstein">
1112      <organization>First Virtual Holdings</organization>
1113      <address><email>nsb@nsb.fv.com</email></address>
1114    </author>
1115    <date month="November" year="1996"/>
1116  </front>
1117  <seriesInfo name="RFC" value="2046"/>
1118</reference>
1119
1120<reference anchor="RFC2119">
1121  <front>
1122    <title>Key words for use in RFCs to Indicate Requirement Levels</title>
1123    <author initials="S." surname="Bradner" fullname="Scott Bradner">
1124      <organization>Harvard University</organization>
1125      <address><email>sob@harvard.edu</email></address>
1126    </author>
1127    <date month="March" year="1997"/>
1128  </front>
1129  <seriesInfo name="BCP" value="14"/>
1130  <seriesInfo name="RFC" value="2119"/>
1131</reference>
1132
1133<reference anchor="RFC5234">
1134  <front>
1135    <title abbrev="ABNF for Syntax Specifications">Augmented BNF for Syntax Specifications: ABNF</title>
1136    <author initials="D." surname="Crocker" fullname="Dave Crocker" role="editor">
1137      <organization>Brandenburg InternetWorking</organization>
1138      <address>
1139      <postal>
1140      <street>675 Spruce Dr.</street>
1141      <city>Sunnyvale</city>
1142      <region>CA</region>
1143      <code>94086</code>
1144      <country>US</country></postal>
1145      <phone>+1.408.246.8253</phone>
1146      <email>dcrocker@bbiw.net</email></address> 
1147    </author>
1148    <author initials="P." surname="Overell" fullname="Paul Overell">
1149      <organization>THUS plc.</organization>
1150      <address>
1151      <postal>
1152      <street>1/2 Berkeley Square</street>
1153      <street>99 Berkely Street</street>
1154      <city>Glasgow</city>
1155      <code>G3 7HR</code>
1156      <country>UK</country></postal>
1157      <email>paul.overell@thus.net</email></address>
1158    </author>
1159    <date month="January" year="2008"/>
1160  </front>
1161  <seriesInfo name="STD" value="68"/>
1162  <seriesInfo name="RFC" value="5234"/>
1163</reference>
1164
1165</references>
1166
1167<references title="Informative References">
1168
1169<reference anchor="RFC2616">
1170  <front>
1171    <title>Hypertext Transfer Protocol -- HTTP/1.1</title>
1172    <author initials="R." surname="Fielding" fullname="R. Fielding">
1173      <organization>University of California, Irvine</organization>
1174      <address><email>fielding@ics.uci.edu</email></address>
1175    </author>
1176    <author initials="J." surname="Gettys" fullname="J. Gettys">
1177      <organization>W3C</organization>
1178      <address><email>jg@w3.org</email></address>
1179    </author>
1180    <author initials="J." surname="Mogul" fullname="J. Mogul">
1181      <organization>Compaq Computer Corporation</organization>
1182      <address><email>mogul@wrl.dec.com</email></address>
1183    </author>
1184    <author initials="H." surname="Frystyk" fullname="H. Frystyk">
1185      <organization>MIT Laboratory for Computer Science</organization>
1186      <address><email>frystyk@w3.org</email></address>
1187    </author>
1188    <author initials="L." surname="Masinter" fullname="L. Masinter">
1189      <organization>Xerox Corporation</organization>
1190      <address><email>masinter@parc.xerox.com</email></address>
1191    </author>
1192    <author initials="P." surname="Leach" fullname="P. Leach">
1193      <organization>Microsoft Corporation</organization>
1194      <address><email>paulle@microsoft.com</email></address>
1195    </author>
1196    <author initials="T." surname="Berners-Lee" fullname="T. Berners-Lee">
1197      <organization>W3C</organization>
1198      <address><email>timbl@w3.org</email></address>
1199    </author>
1200    <date month="June" year="1999"/>
1201  </front>
1202  <seriesInfo name="RFC" value="2616"/>
1203</reference>
1204
1205<reference anchor='RFC3864'>
1206  <front>
1207    <title>Registration Procedures for Message Header Fields</title>
1208    <author initials='G.' surname='Klyne' fullname='G. Klyne'>
1209      <organization>Nine by Nine</organization>
1210      <address><email>GK-IETF@ninebynine.org</email></address>
1211    </author>
1212    <author initials='M.' surname='Nottingham' fullname='M. Nottingham'>
1213      <organization>BEA Systems</organization>
1214      <address><email>mnot@pobox.com</email></address>
1215    </author>
1216    <author initials='J.' surname='Mogul' fullname='J. Mogul'>
1217      <organization>HP Labs</organization>
1218      <address><email>JeffMogul@acm.org</email></address>
1219    </author>
1220    <date year='2004' month='September' />
1221  </front>
1222  <seriesInfo name='BCP' value='90' />
1223  <seriesInfo name='RFC' value='3864' />
1224</reference>
1225
1226<reference anchor="RFC4288">
1227  <front>
1228    <title>Media Type Specifications and Registration Procedures</title>
1229    <author initials="N." surname="Freed" fullname="N. Freed">
1230      <organization>Sun Microsystems</organization>
1231      <address>
1232        <email>ned.freed@mrochek.com</email>
1233      </address>
1234    </author>
1235    <author initials="J." surname="Klensin" fullname="J. Klensin">
1236      <organization/>
1237      <address>
1238        <email>klensin+ietf@jck.com</email>
1239      </address>
1240    </author>
1241    <date year="2005" month="December"/>
1242  </front>
1243  <seriesInfo name="BCP" value="13"/>
1244  <seriesInfo name="RFC" value="4288"/>
1245</reference>
1246
1247</references>
1248
1249<section title="Internet Media Type multipart/byteranges" anchor="internet.media.type.multipart.byteranges">
1250<iref item="Media Type" subitem="multipart/byteranges" primary="true"/>
1251<iref item="multipart/byteranges Media Type" primary="true"/>
1252<t>
1253   When an HTTP 206 (Partial Content) response message includes the
1254   content of multiple ranges (a response to a request for multiple
1255   non-overlapping ranges), these are transmitted as a multipart
1256   message-body (<xref target="RFC2046" x:fmt="," x:sec="5.1"/>). The media type for this purpose is called
1257   "multipart/byteranges".  The following is to be registered with IANA <xref target="RFC4288"/>.
1258</t><t>
1259   The multipart/byteranges media type includes one or more parts, each
1260   with its own Content-Type and Content-Range fields. The required
1261   boundary parameter specifies the boundary string used to separate
1262   each body-part.
1263</t>
1264<t>
1265  <list style="hanging" x:indent="12em">
1266    <t hangText="Type name:">
1267      multipart
1268    </t>
1269    <t hangText="Subtype name:">
1270      byteranges
1271    </t>
1272    <t hangText="Required parameters:">
1273      boundary
1274    </t>
1275    <t hangText="Optional parameters:">
1276      none
1277    </t>
1278    <t hangText="Encoding considerations:">
1279      only "7bit", "8bit", or "binary" are permitted
1280    </t>
1281    <t hangText="Security considerations:">
1282      none
1283    </t>
1284    <t hangText="Interoperability considerations:">
1285      none
1286    </t>
1287    <t hangText="Published specification:">
1288      This specification (see <xref target="internet.media.type.multipart.byteranges"/>).
1289    </t>
1290    <t hangText="Applications that use this media type:">
1291    </t>
1292    <t hangText="Additional information:">
1293      <list style="hanging">
1294        <t hangText="Magic number(s):">none</t>
1295        <t hangText="File extension(s):">none</t>
1296        <t hangText="Macintosh file type code(s):">none</t>
1297      </list>
1298    </t>
1299    <t hangText="Person and email address to contact for further information:">
1300      See Authors Section.
1301    </t>
1302                <t hangText="Intended usage:">
1303                  COMMON
1304    </t>
1305                <t hangText="Restrictions on usage:">
1306                  none
1307    </t>
1308    <t hangText="Author/Change controller:">
1309      IESG
1310    </t>
1311  </list>
1312</t>
1313<figure><preamble>
1314   For example:
1315</preamble><artwork type="example">
1316  HTTP/1.1 206 Partial Content
1317  Date: Wed, 15 Nov 1995 06:25:24 GMT
1318  Last-Modified: Wed, 15 Nov 1995 04:58:08 GMT
1319  Content-type: multipart/byteranges; boundary=THIS_STRING_SEPARATES
1320 
1321  --THIS_STRING_SEPARATES
1322  Content-type: application/pdf
1323  Content-range: bytes 500-999/8000
1324 
1325  ...the first range...
1326  --THIS_STRING_SEPARATES
1327  Content-type: application/pdf
1328  Content-range: bytes 7000-7999/8000
1329 
1330  ...the second range
1331  --THIS_STRING_SEPARATES--
1332</artwork></figure>
1333<t>
1334      Notes:
1335  <list style="numbers">
1336      <t>Additional CRLFs may precede the first boundary string in the
1337         entity.</t>
1338
1339      <t>Although <xref target="RFC2046"/> permits the boundary string to be
1340         quoted, some existing implementations handle a quoted boundary
1341         string incorrectly.</t>
1342
1343      <t>A number of browsers and servers were coded to an early draft
1344         of the byteranges specification to use a media type of
1345         multipart/x-byteranges<iref item="multipart/x-byteranges Media Type"/><iref item="Media Type" subitem="multipart/x-byteranges"/>, which is almost, but not quite
1346         compatible with the version documented in HTTP/1.1.</t>
1347  </list>
1348</t>
1349</section>
1350
1351<section title="Compatibility with Previous Versions" anchor="compatibility">
1352<section title="Changes from RFC 2068" anchor="changes.from.rfc.2068">
1353<t>
1354   Transfer-coding and message lengths all interact in ways that
1355   required fixing exactly when chunked encoding is used (to allow for
1356   transfer encoding that may not be self delimiting); it was important
1357   to straighten out exactly how message lengths are computed.
1358   (<xref target="header.content-range"/>,
1359   see also <xref target="Part1"/>, <xref target="Part3"/> and <xref target="Part6"/>)
1360</t>
1361<t>
1362   There are situations where a server (especially a proxy) does not
1363   know the full length of a response but is capable of serving a
1364   byterange request. We therefore need a mechanism to allow byteranges
1365   with a content-range not indicating the full length of the message.
1366   (<xref target="header.content-range"/>)
1367</t>
1368<t>
1369   Range request responses would become very verbose if all meta-data
1370   were always returned; by allowing the server to only send needed
1371   headers in a 206 response, this problem can be avoided.
1372   (Section <xref target="status.206" format="counter"/>
1373   and <xref target="header.if-range" format="counter"/>)
1374</t>
1375<t>
1376   Fix problem with unsatisfiable range requests; there are two cases:
1377   syntactic problems, and range doesn't exist in the document. The 416
1378   status code was needed to resolve this ambiguity needed to indicate
1379   an error for a byte range request that falls outside of the actual
1380   contents of a document. (Section <xref target="status.416" format="counter"/>, <xref target="header.content-range" format="counter"/>)
1381</t>
1382</section>
1383
1384<section title="Changes from RFC 2616" anchor="changes.from.rfc.2616">
1385<t>
1386  Clarify that it is not ok to use a weak cache validator in a 206 response.
1387  (<xref target="status.206"/>)
1388</t>
1389<t>
1390  Clarify that multipart/byteranges can consist of a single part.
1391  (<xref target="internet.media.type.multipart.byteranges"/>)
1392</t>
1393
1394</section>
1395
1396</section>
1397
1398<section xmlns:x="http://purl.org/net/xml2rfc/ext" title="Collected ABNF" anchor="collected.abnf">
1399<figure>
1400<artwork type="abnf" name="p5-range.parsed-abnf">
1401<x:ref>Accept-Ranges</x:ref> = "Accept-Ranges:" OWS Accept-Ranges-v
1402<x:ref>Accept-Ranges-v</x:ref> = acceptable-ranges
1403
1404<x:ref>Content-Range</x:ref> = "Content-Range:" OWS Content-Range-v
1405<x:ref>Content-Range-v</x:ref> = content-range-spec
1406
1407<x:ref>HTTP-date</x:ref> = &lt;HTTP-date, defined in [Part1], Section 3.2&gt;
1408
1409<x:ref>If-Range</x:ref> = "If-Range:" OWS If-Range-v
1410<x:ref>If-Range-v</x:ref> = entity-tag / HTTP-date
1411
1412<x:ref>OWS</x:ref> = &lt;OWS, defined in [Part1], Section 1.2.2&gt;
1413
1414<x:ref>Range</x:ref> = "Range:" OWS Range-v
1415<x:ref>Range-v</x:ref> = byte-ranges-specifier / other-ranges-specifier
1416
1417<x:ref>acceptable-ranges</x:ref> = ( *( "," OWS ) range-unit *( OWS "," [ OWS
1418 range-unit ] ) ) / "none"
1419
1420<x:ref>byte-content-range-spec</x:ref> = bytes-unit SP byte-range-resp-spec "/" (
1421 instance-length / "*" )
1422<x:ref>byte-range-resp-spec</x:ref> = ( first-byte-pos "-" last-byte-pos ) / "*"
1423<x:ref>byte-range-set</x:ref> = ( *( "," OWS ) byte-range-spec ) / (
1424 suffix-byte-range-spec *( OWS "," [ ( OWS byte-range-spec ) /
1425 suffix-byte-range-spec ] ) )
1426<x:ref>byte-range-spec</x:ref> = first-byte-pos "-" [ last-byte-pos ]
1427<x:ref>byte-ranges-specifier</x:ref> = bytes-unit "=" byte-range-set
1428<x:ref>bytes-unit</x:ref> = "bytes"
1429
1430<x:ref>content-range-spec</x:ref> = byte-content-range-spec /
1431 other-content-range-spec
1432
1433<x:ref>entity-tag</x:ref> = &lt;entity-tag, defined in [Part4], Section 2&gt;
1434
1435<x:ref>first-byte-pos</x:ref> = 1*DIGIT
1436
1437<x:ref>instance-length</x:ref> = 1*DIGIT
1438
1439<x:ref>last-byte-pos</x:ref> = 1*DIGIT
1440
1441<x:ref>other-content-range-spec</x:ref> = other-range-unit SP other-range-resp-spec
1442<x:ref>other-range-resp-spec</x:ref> = *CHAR
1443<x:ref>other-range-unit</x:ref> = token
1444<x:ref>other-ranges-specifier</x:ref> = 1*CHAR
1445
1446<x:ref>range-unit</x:ref> = bytes-unit / other-range-unit
1447
1448<x:ref>suffix-byte-range-spec</x:ref> = "-" suffix-length
1449<x:ref>suffix-length</x:ref> = 1*DIGIT
1450
1451<x:ref>token</x:ref> = &lt;token, defined in [Part1], Section 1.2.2&gt;
1452
1453
1454</artwork>
1455</figure>
1456<figure><preamble>ABNF diagnostics:</preamble><artwork type="inline">
1457; Accept-Ranges defined but not used
1458; Content-Range defined but not used
1459; If-Range defined but not used
1460; Range defined but not used
1461</artwork></figure></section>
1462
1463<section title="Change Log (to be removed by RFC Editor before publication)" anchor="change.log">
1464
1465<section title="Since RFC2616">
1466<t>
1467  Extracted relevant partitions from <xref target="RFC2616"/>.
1468</t>
1469</section>
1470
1471<section title="Since draft-ietf-httpbis-p5-range-00">
1472<t>
1473  Closed issues:
1474  <list style="symbols"> 
1475    <t>
1476      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/18"/>:
1477      "Cache validators in 206 responses"
1478      (<eref target="http://purl.org/NET/http-errata#ifrange206"/>)
1479    </t>
1480    <t>
1481      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/35"/>:
1482      "Normative and Informative references"
1483    </t>
1484    <t>
1485      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/86"/>:
1486      "Normative up-to-date references"
1487    </t>
1488  </list>
1489</t>
1490</section>
1491
1492<section title="Since draft-ietf-httpbis-p5-range-01">
1493<t>
1494  Closed issues:
1495  <list style="symbols"> 
1496    <t>
1497      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/55"/>:
1498      "Updating to RFC4288"
1499    </t>
1500  </list>
1501</t>
1502<t>
1503  Ongoing work on ABNF conversion (<eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/36"/>):
1504  <list style="symbols"> 
1505    <t>
1506      Add explicit references to BNF syntax and rules imported from other parts of the specification.
1507    </t>
1508  </list>
1509</t>
1510</section>
1511
1512<section title="Since draft-ietf-httpbis-p5-range-02" anchor="changes.since.02">
1513<t>
1514  Ongoing work on IANA Message Header Registration (<eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/40"/>):
1515  <list style="symbols"> 
1516    <t>
1517      Reference RFC 3984, and update header registrations for headers defined
1518      in this document.
1519    </t>
1520  </list>
1521</t>
1522</section>
1523
1524<section title="Since draft-ietf-httpbis-p5-range-03" anchor="changes.since.03">
1525<t>
1526</t>
1527</section>
1528
1529<section title="Since draft-ietf-httpbis-p5-range-04" anchor="changes.since.04">
1530<t>
1531  Closed issues:
1532  <list style="symbols"> 
1533    <t>
1534      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/133"/>:
1535      "multipart/byteranges minimum number of parts"
1536    </t>
1537  </list>
1538</t>
1539<t>
1540  Ongoing work on ABNF conversion (<eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/36"/>):
1541  <list style="symbols"> 
1542    <t>
1543      Use "/" instead of "|" for alternatives.
1544    </t>
1545    <t>
1546      Introduce new ABNF rules for "bad" whitespace ("BWS"), optional
1547      whitespace ("OWS") and required whitespace ("RWS").
1548    </t>
1549    <t>
1550      Rewrite ABNFs to spell out whitespace rules, factor out
1551      header value format definitions.
1552    </t>
1553  </list>
1554</t>
1555</section>
1556
1557<section title="Since draft-ietf-httpbis-p5-range-05" anchor="changes.since.05">
1558<t>
1559  Closed issues:
1560  <list style="symbols"> 
1561    <t>
1562      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/142"/>:
1563      "State base for *-byte-pos and suffix-length"
1564    </t>
1565  </list>
1566</t>
1567<t>
1568  Ongoing work on Custom Ranges (<eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/85"/>):
1569  <list style="symbols"> 
1570    <t>
1571      Remove bias in favor of byte ranges; allow custom ranges in ABNF.
1572    </t>
1573  </list>
1574</t>
1575<t>
1576  Final work on ABNF conversion (<eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/36"/>):
1577  <list style="symbols"> 
1578    <t>
1579      Add appendix containing collected and expanded ABNF, reorganize ABNF introduction.
1580    </t>
1581  </list>
1582</t>
1583</section>
1584
1585<section title="Since draft-ietf-httpbis-p5-range-06" anchor="changes.since.06">
1586<t>
1587  Closed issues:
1588  <list style="symbols"> 
1589    <t>
1590      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/161"/>:
1591      "base for numeric protocol elements"
1592    </t>
1593  </list>
1594</t>
1595</section>
1596
1597</section>
1598
1599</back>
1600</rfc>
Note: See TracBrowser for help on using the repository browser.