Wirebook

Wirebook › Bonus lesson

Why can a download pick up where it left off?

Bonus lesson · about 6 minutes · hands-on · nothing you type leaves your browser

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.

Numbered pieces of a pretend file

This download lives only in your browser — nothing is uploaded. Press Start, then Interrupt. Try again with restart from zero versus resume with ranges and watch the piece counters.

0pieces kept
12still needed
0pieces sent this run
0re-sent (wasted)

Ask for a numbered range of bytes

Grown-up browsers and download managers speak HTTP byte ranges. They say “please send bytes 400000–599999” and the server answers with 206 Partial Content — just that slice, not the whole file again.

Pretend file size: 1,000,000 bytes (about 1 MB). The highlighted slice is what the next request would ask for.


    

    

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.

When resume works — and when it doesn’t

SituationWhat usually happens
Server supports ranges (Accept-Ranges: bytes)Resume asks for missing bytes; 206 comes back with just that slice
Server ignores rangesYou get the whole file again (200 OK) — restart behaviour
File changed on the server mid-downloadOld pieces may no longer match; a careful client starts over
Tiny file / first visitOften just fetch the whole thing once — resume is for long transfers

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.

Words from this lesson

Earn a bonus badge

Get all 3 right to collect the Interrupted downloads bonus badge. Bonus badges are extra: they don't change your stamp count or rank. Wrong answers are fine: just try again.

1. A big download stops halfway. What does a clever resume do next?

2. What does HTTP status 206 Partial Content mean?

3. Why is restart-from-zero wasteful after an interruption?

Try another lesson

  1. 3Can a website get tired?7 min · interactive
  2. 12How does a game remember where you got to?6 min · interactive
  3. 1What happens when you open a web page?6 min · interactive