HTTPfy

206 Partial Content

The server is sending only the byte range(s) the client asked for with a Range header.

206 at a glance

Code
206
Name
Partial Content
Class
2xx Successful
Status
IANA-registered standard code
Defined in
RFC 9110, Section 15.3.7
Cacheable by default
Yes, heuristically cacheable (RFC 9110 section 15.1): without Cache-Control or Expires, caches may store it and pick a freshness lifetime themselves. Send explicit Cache-Control to stay in control.

What 206 means

206 Partial Content answers a Range request. The Content-Range header says which bytes are in the body and the full size. It powers video and audio seeking, resumable downloads and parallel download managers. Multiple ranges come back as multipart/byteranges. It is heuristically cacheable.

What typically causes a 206

  • Browsers seeking in <video> and <audio> elements.
  • curl -C -, wget -c and download managers resuming or splitting downloads.
  • PDF viewers fetching pages on demand.

Fix it on the server

  • Advertise support with Accept-Ranges: bytes. nginx and Apache handle static files automatically.
  • Compression and ranges interact badly: ranges apply to the encoded bytes, so many servers disable gzip for range requests.
  • Return 416 for ranges beyond the end of the file.

Fix it as a client or visitor

  • Send If-Range with the ETag when resuming so you do not stitch together two versions of a file.

Headers that go with 206

HeaderRole
Content-RangeBytes sent and total length, e.g. bytes 0-1023/146515.
Accept-Rangesbytes if ranges are supported.
RangeRequest header naming the wanted bytes.

Example response

HTTP/1.1 206 Partial Content
Content-Type: video/mp4
Content-Range: bytes 0-1048575/52428800
Content-Length: 1048576
Accept-Ranges: bytes

Opens the HTTP headers tool with your URL filled in; it shows the status line and headers of every redirect hop.