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

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

Upgrade to latest version of rfc2629.xslt and xml2rfc.tcl; bump up document dates

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