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

Last change on this file since 637 was 637, checked in by ylafon@…, 10 years ago

Resolve #151: Fixed the grammar to require the range-unit "=" range-set syntax (closes #151)

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