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

Last change on this file since 1163 was 1163, checked in by fielding@…, 9 years ago

Remove header field classifications.

Addresses #224 and #104

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