HTTP partial representation assembly with identity and offsets, not URL migration or temporary-sharing expiry.
Substantively revised October 21, 2026. Author interpretation, documented cases and hypothetical examples are distinguished below.
A resumed download can finish at the expected size and still be neither version of the original file. Four bytes retained yesterday can be joined to eight bytes published today. The progress indicator reaches twelve bytes, but the assembled object never existed on the server. File length establishes coverage, not a shared version.
Direct answer
Before appending a resumed response, establish that the retained prefix and new bytes belong to the same selected representation and that the returned interval starts at the retained length. Inspect the actual response rather than assuming the server honored the requested range. A full 200 response requires replacement handling, not append handling. Use an appropriate representation validator with a conditional range request, and keep the byte-counting basis consistent. If those conditions cannot be established, restart into a separate object instead of guessing that the URL still identifies the same bytes.
Key takeaways
A URL identifies a request target, not an immutable byte sequence. The content served there can change between attempts. An expected total size can remain unchanged across two versions, so a length check cannot establish that fragments belong together.
Requested and returned ranges are different evidence. The request expresses what the client wants; the response status and range metadata describe what it received. Appending every successful response treats a complete replacement as if it were a missing suffix.
Conditional requests help connect a retained representation to the next attempt. They do not eliminate response inspection, local-state consistency or final verification appropriate to the delivery. A small example can demonstrate mixed-version assembly without claiming that a demonstration function is a general HTTP downloader.
Definitions and relationships
A selected representation is the data and associated metadata chosen for a request. A byte range describes positions within that representation's byte sequence. A retained prefix is the initial sequence already stored locally; its length determines the next desired offset only if it is contiguous and corresponds to the representation being resumed.
A validator provides information used to distinguish or compare representation states. An entity tag, usually called an ETag, is not necessarily a content hash. Do not infer its algorithm from its appearance. The relevant property for this article is whether it is suitable for strong comparison in a conditional range request.
Content-Range locates the returned bytes within a representation. Content-Length, when present, describes the response content length rather than automatically describing the complete downloadable object. These fields answer different questions. Position, returned length and representation identity must agree before a prefix and suffix can be treated as one object.
The problem with remembering only a byte count
Imagine a hypothetical research assistant downloading an archive over an interrupted connection. The local file contains a prefix, and a note records only the number of bytes received. The next attempt requests the remainder from the same URL. Meanwhile, the publisher has replaced the archive without changing its total size.
Both transfer attempts can succeed individually. The first supplied bytes from the old representation; the second supplied bytes from the new one. The error appears when the client interprets the two successful transfers as evidence of one consistent object. Network success does not supply the missing relationship between them.
The retained state therefore needs more than a progress number. It must connect the local prefix to its representation and byte basis. Otherwise the resumption procedure begins with an unsupported assumption, and later checks of total size merely confirm that the client joined the expected number of bytes.
Root cause: progress is confused with continuity
A progress display encourages a simple model: the first portion is done, so only the remainder matters. That model is valid only while the stored portion remains a prefix of the representation selected for continuation. A changed server object, a different content coding or inconsistent local state can invalidate that premise.
There are two separate continuity questions. Does the new response belong to the same representation? Does it begin at the exact next byte? A matching version indication cannot repair a wrong offset, and a correct offset cannot repair a different version. Treating either as a complete proof leaves the other failure undetected.
The practical repair is to make append permission conditional on both relationships. The default action should be determined by the response actually received. A complete body belongs in a replacement object, a verified suffix may extend a prefix, and an ambiguous response should preserve the prefix while the client decides how to restart.
Framework: the Fragment Continuity Ledger
The Fragment Continuity Ledger is the author's proposed inspection method. Its components are Retained Basis, Returned Interval, Version Link and Write Decision. It organizes the evidence needed for one append decision; it does not define a complete HTTP implementation or a substitute for an established download library.
Retained Basis records what the local bytes represent. Include the contiguous prefix length, the selected representation's relevant identity information and the content-coding basis. A count derived from decoded bytes cannot automatically be used as an offset in an encoded representation. The stored prefix and its metadata must describe the same state.
Returned Interval asks what the response actually contains. Distinguish a partial response from a complete body, and inspect the interval and available total. For a simple suffix completion, the returned start must equal the stored prefix length. An interval that starts later leaves a gap; one that starts earlier overlaps existing bytes.
Version Link connects the earlier and later selections. A suitable strong validator can support conditional range handling. A weak entity tag must not be placed in If-Range. The ledger records the actual basis used rather than assuming a familiar URL or unchanged total length supplies version continuity.
Write Decision selects append, replacement or rejection. Make that decision before modifying the retained object. If the response is a complete new representation, store it as a replacement candidate. If the interval or identity evidence is inconsistent, retain the old state for diagnosis and restart deliberately rather than partially overwriting the evidence.
Applying the ledger to one final suffix
Consider a restricted case with a known twelve-byte representation and a four-byte retained prefix. The requested continuation begins at offset four, since byte numbering starts at zero. The desired final interval runs through offset eleven. Its length is eight bytes, because the endpoints are inclusive.
Record the retained validator and request a conditional continuation. On receiving a partial response, inspect the interval and the relevant representation evidence. A response beginning at five cannot fill the missing byte at four. A response containing eight bytes is insufficient evidence if its interval is unknown or belongs to another version.
If a full body arrives instead, process it as a fresh replacement. The fact that the request contained Range does not turn that complete body into a suffix. This response-driven write decision is the ledger's main operational benefit: request intent never becomes permission to append without examining what came back.
Documented example: inclusive byte positions
RFC 9110 defines byte-range positions using zero-based inclusive endpoints. That convention explains the eight-byte suffix in the controlled example: positions four through eleven include both four and eleven. An off-by-one mistake can create a gap or duplicate a boundary byte even when every fragment comes from the correct representation. [S1]
This is a documented protocol mechanism, not an incident attributed to a real user. Its lesson is that a range string is a positional statement, not merely an amount. A client that remembers eight missing bytes but loses the correct starting position has discarded part of the information needed for assembly.
The experiment uses an explicit final interval so its acceptance rule can be inspected easily. Real clients may accept several partial responses and maintain more complex coverage state. That broader implementation requires additional handling; the small fixture does not claim to implement it.
Documented example: partial content versus a complete body
MDN's range-request guide illustrates a 206 response with Content-Range locating the returned bytes. It also distinguishes the response content length from the full representation length. This separation matters when a status labeled successful is mistakenly treated as a universal instruction to append. [S2]
A complete response has a different write consequence from a partial interval. Receiving the entire current object can be useful, especially when restarting is necessary, but it should not be concatenated after an old prefix. The same response can be acceptable as replacement data and unacceptable as append data.
The important pattern is to classify the received object before mutating the retained one. Do not let an append-only file handle make that decision implicitly. A write operation selected before the status and interval are inspected can turn an otherwise understandable response into an oversized or internally inconsistent local artifact.
Documented example: conditional continuation
MDN describes If-Range as making continuation conditional: a satisfied condition permits partial transfer, while a failed condition leads to the full current representation. Its header reference explicitly excludes a weak entity tag from this use. These documented behaviors explain why fallback handling is part of resumption rather than an exceptional afterthought. [S3]
For the article's demonstration, the retained tag is a simple strong tag, and the response-decision function conservatively requires an exact matching response tag before appending. That is a deliberately stricter fixture policy. It should not be presented as a complete description of every protocol-permitted response or every way a compliant client can establish continuity.
The broader lesson remains useful: record the version relationship instead of inventing one from a filename. A validator links transfer attempts under defined rules. It is not authentication of a publisher, a universal checksum or permission to combine fragments whose byte positions do not match.
Case study: a complete-looking object that never existed
The author created two synthetic twelve-byte objects in memory. The first was AAAABBBBCCCC and the second XXXXYYYYZZZZ. The retained prefix consisted of the first four bytes of the first object, AAAA. No network request was sent, and neither object was a customer's file or a real server response.
Appending the final eight bytes of the first object reconstructs AAAABBBBCCCC. Appending the final eight bytes of the second produces AAAAYYYYZZZZ. That mixed result still contains twelve bytes, yet it equals neither original object. The test separates a successful length check from successful version continuity using a specimen that can be inspected directly.
The demonstration's accepted partial response specifies bytes 4-11/12 and the retained strong tag. A matching eight-byte body permits append. A changed tag is rejected while preserving the four-byte prefix. The negative result shows what the local policy refuses, rather than claiming that a real server emitted the hypothetical inconsistent response.
The complete-body case uses a 200 response containing the second object. The decision selects replacement, yielding exactly XXXXYYYYZZZZ. A naive append would produce sixteen bytes by placing the complete twelve-byte body after the retained four-byte prefix. That error differs from the equal-length mixed-version failure, so both checks are useful.
What the twenty-two assertions cover
The Python 3.11.9 experiment records twenty-two passing assertions. They cover source and prefix lengths, inclusive interval arithmetic, valid reconstruction, changed-tag rejection, unchanged retained bytes, the misleading twelve-byte mixed object and complete-response replacement behavior. Additional negative inputs exercise the fixture's restricted acceptance policy.
Those inputs include a wrong starting offset, a different reported total, a response that does not complete the final suffix, missing range metadata, a short body, a weak retained tag, a missing response tag, a 416 status and an unexpected gzip content coding. The function returns a decision and bytes; it does not persist files or implement a real network client.
Some refusals are intentionally conservative. A real downloader can handle several partial intervals or additional valid protocol cases with appropriate state. This fixture instead accepts one known-length final suffix under an exact response-tag policy. Its passing assertions establish the stated decision examples, not general HTTP conformance or an audit of any deployed download service.
Failure example: treating 416 as a completion certificate
A range-not-satisfiable response can tempt a client to conclude that its local copy is already complete. That inference skips the version question. Even a local file whose length matches a reported current length can contain bytes from another version or have a different local history.
The synthetic function therefore rejects a 416 response as an append result and makes no completion claim from it. It does not attempt the separate recovery procedure needed to inspect a possibly complete local object. A refusal to append is narrower than a diagnosis of why the server rejected the requested interval.
The correction is to evaluate completion using evidence appropriate to the retained representation and actual bytes. Do not reinterpret a status about the requested range as proof of local content identity. Progress state and object verification should remain separate records until their relationship has been established.
Content coding changes the counting basis
A byte position is meaningful only within a particular sequence. If the local prefix was counted after decoding while the server's range refers to encoded bytes, the same number can point to different data. The offset is not wrong arithmetically; it belongs to the wrong coordinate system.
The experiment avoids this complexity by restricting acceptance to identity coding and rejecting an unexpected encoded body. That choice makes the fixture's byte basis explicit. It does not implement compressed-representation resumption, automatic decompression or a negotiation policy for a production HTTP library.
For a real tool, inspect what the library exposes and stores. A transparent decoding feature can be convenient while making a saved byte count unsuitable for direct reuse as a wire-level range offset. Record the actual representation basis rather than assuming every layer measures the same sequence.
Common mistakes and precise corrections
The first mistake is treating an unchanged URL as an immutable file identity. Store suitable representation evidence with the prefix. If the link serves a new selection, the client needs a new assembly decision even when the path and filename remain familiar.
The second is checking only the finished length. Keep the length check, but give it the correct role: it detects some coverage errors, not every mixed-version object. The twelve-byte synthetic hybrid demonstrates why version evidence cannot be replaced by a progress total.
The third is appending every body received after a range request. Classify the actual response first. A complete body can be stored as a replacement; it does not become a suffix because the client requested one. A request is an instruction sent, not an observation received.
The fourth is promoting this demonstration into a production downloader. It lacks multipart handling, real network behavior, date validators, persistence, crash recovery and cryptographic verification. Use its examples to inspect an established implementation's decisions, not as a claim that twenty-two assertions cover the entire protocol.
Counterargument: restarting is simpler and safer
Restarting into a new object can be the best decision when the file is small, the retained state is ambiguous or the implementation lacks reliable resumption. Saving a few transferred bytes does not justify an assembly procedure whose assumptions cannot be explained. The ledger can legitimately end with a restart decision.
Resumption becomes more valuable when transfer cost and interruption frequency make repeated full retrieval expensive. That benefit creates an engineering tradeoff, not permission to omit continuity checks. The cost of maintaining representation-aware state should be evaluated alongside the cost of retransferring the object.
The method's purpose is to make that tradeoff concrete. If the available client can establish the needed relationships, continuation may be reasonable. If it remembers only a byte count and URL, a fresh object is easier to justify than a speculative append followed by a misleading completion message.
Action plan
Inspect one authorized download workflow and identify exactly what survives an interruption. Determine whether the saved prefix, its length and its representation evidence are recorded together. Avoid changing a working production path merely to run an unreviewed demonstration.
Review the client's handling of partial, complete and unsatisfied-range responses. Use controlled fixtures to ask whether a full response replaces rather than extends an old prefix, whether a wrong interval is refused and whether a changed version can silently pass a total-length check.
Document the byte basis, including the role of content decoding. If the implementation cannot connect the retained count to the requested representation, choose a fresh transfer. Keep the previous partial object separate until the replacement is accepted so the investigation does not destroy its own evidence.
Finally, inspect the finished artifact using verification appropriate to the actual delivery. Record network, storage and content checks only when performed. The in-memory demonstration supports reasoning about decisions; production acceptance belongs to observations of the real implementation and delivered bytes.
FAQ
Is the same URL enough to resume safely?
No. The representation served at that target can change. The retained prefix needs a version relationship to the response, not merely a remembered request address.
Does the expected total length prove the fragments match?
No. The synthetic mixed object has the expected twelve-byte length while equaling neither original version. Length checks coverage and cannot alone establish shared identity.
Where does continuation begin after a four-byte prefix?
At offset four in zero-based byte numbering, provided the prefix is contiguous and belongs to the representation being continued. The retained metadata and bytes must describe the same state.
How long is the interval from four through eleven?
Eight bytes, because both endpoints are inclusive. Calculate eleven minus four plus one rather than treating the final position as an exclusive boundary.
Should a 200 response be appended after the prefix?
No. A full response needs replacement handling. In the fixture, appending twelve complete bytes after a four-byte prefix produces sixteen bytes and the wrong artifact.
Does a requested range guarantee partial content will arrive?
No. Inspect the response actually received. The client must have a sensible full-response path instead of selecting append behavior solely from its request headers.
Is an ETag necessarily a cryptographic checksum?
No. Its appearance does not establish a hashing algorithm. Treat its comparison semantics separately from any independently supplied content digest or publisher-authentication requirement.
Can a weak ETag be used in If-Range?
No. The cited header reference excludes weak entity tags from this use. Do not remove a weak marker locally and pretend the server supplied a different kind of validator.
Does the fixture cover date-based conditions?
No. It uses a restricted strong-tag policy. Date validators have their own conditions and are outside the implemented response-decision experiment.
Does a 416 response establish local completion?
No. The fixture refuses to append and makes no claim that the retained bytes are complete or correct. Completion requires a separate evaluation of the local object and its representation.
Why reject unexpected gzip content in this example?
The example's prefix and offsets use an identity-coded byte basis. It does not implement the different accounting needed for encoded representations or transparent decoder behavior.
Did the twenty-two assertions exercise a real server?
No. They evaluate synthetic response inputs in memory. There was no network transfer, browser test, deployed-service audit or real-world download failure investigation.
Must every valid partial response finish the file?
No. The demonstration restricts acceptance to one final suffix for clarity. General clients can support additional partial intervals with appropriate coverage and continuity state.
What should happen when the interval starts too late?
Do not concatenate it as though it immediately followed the prefix. That would leave a gap. Preserve the retained state and use an implementation that can correctly request or manage the missing coverage.
When should the client abandon resumption?
When it cannot establish the necessary representation and positional relationships at an acceptable cost. Restarting into a separate object is a legitimate decision, especially when the retained state is incomplete or ambiguous.
Recommended books
Designing Data-Intensive Applications, first edition, by Martin Kleppmann, published by O'Reilly in March 2017, offers background on consistency and state across distributed operations. Its relevance is the danger of treating individually successful steps as proof of a consistent whole. It does not define the current HTTP range rules.
The Pragmatic Programmer, twentieth anniversary edition, by David Thomas and Andrew Hunt, published in September 2019, provides context for inspecting assumptions with small reproducible examples. The twelve-byte objects serve that investigative purpose; their simplicity is not a claim that production download behavior is equally small.
A Philosophy of Software Design, second edition, by John Ousterhout, published in July 2021, provides context for making state and interface responsibilities explicit. Its relevance is separating append permission from the low-level write call. The Fragment Continuity Ledger remains the author's proposed inspection method, not a framework attributed to that book.
Further exploration
Find one workflow that displays resumed progress and ask what evidence authorizes the next append. Follow the answer from retained bytes through representation identity and returned position to the eventual write decision. A visible percentage is useful only when the object it describes remains coherent.
Then test the smallest controlled example that can contradict the workflow's assumption: two equally long versions, a complete fallback body or a shifted interval. Record the actual implementation's behavior separately from the hypothetical inputs. A reliable completion claim should explain which object was assembled, not merely how many bytes arrived.
Primary evidence sources
- [S1] Actual RFC9110 inclusive byte offsets, content-coding byte basis, server MAY ignore Range and If-Range strong validator conditions read.
- [S2] Actual206 and Content-Range response examples read.
- [S3] Actual weak ETag prohibited in If-Range read.
Related concepts: systems thinking, wealth structure, and the survival loop. Read the editorial policy and citation guide.