Wirebook › Bonus lesson
Why can a download pick up where it left off?
You start downloading a big file, the train goes into a tunnel, and the connection drops. When you try again, does the computer start from scratch — or ask for only the missing pieces? Here you can break a pretend download into numbered pieces, interrupt it, and see why “resume” can skip the bits you already have.
What the pieces are really called
A big download is just a long row of bytes. When the connection dies at byte 400,000, your device already has the first 400,000. Asking for the whole file again would waste time and data. Instead it can send a range request: “give me from byte 400,000 to the end.” The server replies with status 206 and only those bytes. Your device stitches the old piece and the new piece into one complete file.
- Number the slices. Each piece has a start and end byte, like chapter numbers in a book.
- Keep what arrived. Saved pieces stay on disk (or in memory) until the file is whole.
- Ask only for gaps. A resume request names the missing ranges; a restart throws the kept pieces away.
- Check the glue. Many downloads also check a fingerprint (checksum) so a damaged piece is fetched again, not trusted.
Related lessons: why a video call goes blurry (squeezing a live stream), how a message crosses the world (packets), how a game remembers progress (keeping work on disk). Grown-up twin: Anvil’s HTTP status helpers, and Tooltern guides on HTTP 206 Partial Content, when a download won’t resume, 416 Range Not Satisfiable, resuming with curl or wget, reading the Content-Range label, plus ETIMEDOUT / ECONNRESET when a transfer dies mid-flight.