Asking for a slice
A range request lets a client ask for only part of a resource using the Range header, for example bytes from one offset to another. The server replies with status 206 Partial Content and a Content Range header describing which bytes it sent.
Advertising and validating
- The server signals support with Accept Ranges bytes; otherwise the client must download the whole file.
- A resumed download should include an If Range validator using an ETag or last modified date, so the server can confirm the file has not changed since the first part was fetched.
- If the file changed, the server returns the full body instead to avoid stitching mismatched bytes.
Where it shines
Range requests power resumable downloads after a dropped connection, video seeking where the player jumps to a timestamp, and parallel downloads that fetch several ranges at once. Without them a single network blip would force a restart from byte zero.
A request for a range beyond the file size returns 416 Range Not Satisfiable.
Key idea
Range requests fetch byte slices with status 206 and a Content Range header, enabling resumable downloads, seeking, and parallel fetches when the server advertises Accept Ranges.