source: draft-ietf-httpbis/14/p5-range.xml @ 1271

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

-14

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