2026-09-17 · 6 min read · Rahul Chitturi
- http
- range-requests
- downloads
Range requests let a client retrieve selected bytes from a representation. They support resumable downloads, media seeking, and partial cache fills, but an off-by-one offset or representation change can silently assemble a corrupt file.
HTTP byte ranges are inclusive at both ends. A request for bytes 0-99 asks for 100 bytes, and a successful single-range response should describe the same interval in Content-Range.
Trace one representation and one interval
Capture the request Range and If-Range fields, response status, Content-Range, Content-Length, Content-Encoding, ETag, and final representation size. Compare numbers as bytes, not characters or decoded media positions.
- Expect 206 for a satisfiable partial response.
- Expect 416 with the current total length for an unsatisfied range.
- Treat a 200 response as a complete replacement, not the requested slice.
- Verify adjacent chunks neither overlap nor leave gaps.
Keep validators and encodings aligned
If-Range allows a server to send a range only while the selected representation is unchanged. A stale validator should cause a complete response so the client can discard old partial bytes.
Compression can change which bytes are being ranged. Record whether offsets refer to the encoded representation on the wire, and do not combine chunks obtained under different validators or content encodings.
Reproduce with harmless fixtures
Use the URL tool to inspect the request target, units converter for offset calculations, hash tool for public fixture checksums, and diff for captured header sets.
Test zero-length files, open-ended and suffix ranges, the last byte, out-of-bounds starts, changed ETags, compression, redirects, caches, parallel chunks, interrupted retries, and servers that ignore Range.