Range requests
HTTP 206 Partial Content, and what it is for
206 Partial Content means the server sent part of a file, because part is what was asked
for. The client names a byte range in a Range header; the server answers 206
and says which bytes it sent in Content-Range. It is how a video starts from
the middle, how a download resumes, and how Foretaste lists a 40 MB archive after
reading 67 KB of it.
01
A real exchange
This site has a 19.5 MB sample archive. Asking for its last 64 KB - where a ZIP keeps its index - looks like this. The request:
GET /samples/field-trip.zip HTTP/1.1
Host: foretaste.page
Range: bytes=-65536 And the answer, taken from the live server:
HTTP/1.1 206 Partial Content
Content-Type: application/zip
Content-Length: 65536
Content-Range: bytes 19438962-19504497/19504498
Accept-Ranges: bytes
Three headers carry the meaning. Content-Length is the size of what was sent,
not of the file. Content-Range says which bytes those are and, after the slash,
the size of the whole file. Accept-Ranges: bytes tells the client it can keep
asking for pieces.
bytes=-65536 is a suffix range: "the last 65,536 bytes", whatever the size.
bytes=0-99 is the first hundred, and bytes=500- is everything from
byte 500 on.
02
When the answer is not 206
- 200 OK with the whole file. The server ignored the range. That is allowed, so a client has to check the status rather than trust the request. This site's own host did it to the sample archive until 30 September 2026 - ten bytes asked for, 19.5 MB returned - and the fix was a few lines in the Worker that serves it.
- 416 Range Not Satisfiable. The range starts past the end. The server sends
Content-Range: bytes */19504498, the real size, so the client can try again. - A multipart answer. Ask for several ranges at once and a server may reply with
multipart/byteranges, one part per range, each with its ownContent-Range.
03
Why a ZIP can be read from its end
A ZIP file keeps a table of contents - the central directory - at the very end, with the name, size and position of every file inside. So a client can ask for the tail, read the table, and then ask for only the one file someone wants to open.
Measured on a 40 MB archive over HTTP: listing it cost about 67 KB, 0.17% of the file, and opening one small file inside it cost 97 bytes. Foretaste counts those bytes as they arrive and shows the figure under the file, and a drawer underneath lists every request it made in plain words - "Asked for the last 64 KB", "Sent that part". Opening a ZIP without downloading it is the longer account; the playground runs it on this site's sample, in your tab.
The same trick works on any format that keeps its index at the end. A PDF's cross-reference table and a Parquet file's footer are two more, which is how a Parquet schema can be shown without reading a single data page.
04
Testing a server yourself
curl -s -D - -o /dev/null -H "Range: bytes=0-99" https://example.com/file.zip
A 206 with a Content-Range line means ranges work. A
200 means the server sent everything and ranges do not. When a site refuses
outright with a 401, 403 or 429, that is a different conversation - see
why a site refuses to open a file.
The questions people ask
Is HTTP 206 an error?
No. 206 is a success: the server sent the part of the file that was asked for, and the Content-Range header says which part and how big the whole file is. Video players and download managers rely on it every day.
Why does my server return 200 instead of 206?
Because it ignored the Range header and sent the whole file. Some servers and CDNs do not support ranges, or switch them off for compressed or dynamic responses. A client should check for 206 and Content-Range rather than assume; Foretaste does, and says so under the file when a site sent everything.
What does 416 Range Not Satisfiable mean?
The range asked for starts past the end of the file. The server answers 416 with a Content-Range of bytes */ followed by the real size, so the client can ask again correctly.
How do I test whether a server supports range requests?
Send a range and look at the answer: curl -s -D - -o /dev/null -H "Range: bytes=0-99" followed by the address. A 206 with Content-Range means ranges work; a 200 means they do not. An Accept-Ranges: bytes header on a HEAD response is a hint, not a promise.