Guides · Product
How download managers work: segments, byte ranges and resume.
A plain-English look inside a download manager: HTTP Range requests, parallel connections, dynamic splitting and how a partial file survives a crash.
Key takeaways
- A browser normally downloads a file over one connection; a download manager opens several at once, each asking for a different slice of the same file.
- The trick is the HTTP
Rangeheader, which lets a client ask for "bytes 0 to 999" instead of the whole file. - Resume after a crash works because the manager saves which byte ranges are already on disk.
- It only helps when the server allows ranges and when the limit is per connection, not your whole line.
The one idea behind every download manager
Every download manager, paid or free, is built on one observation: a web server does not have to send you a file from start to finish in one go. It can send any slice of it you ask for. If you can ask for slices, you can ask for several at the same time, and you can come back later for the slices you are still missing.
That is the whole idea. Everything else, the speed graph, the queue, the browser button, is packaging around it.
Step 1: asking the server what it can do
Before downloading anything, a good manager sends a small probe request. TurboGet sends a normal GET with the header Range: bytes=0-0, which asks for just the first byte. The reply tells it four useful things:
- The file size, from the
Content-Rangeheader (for examplebytes 0-0/104857600). - Whether ranges are supported. A server that supports them answers
206 Partial Content. A server that ignores the header answers200and starts sending the whole file. - Validators: the
ETagandLast-Modifiedheaders, which identify this exact version of the file. - The real filename, usually in
Content-Disposition.
A HEAD request can fetch some of this, but some servers answer HEAD differently from GET, so a tiny ranged GET is the more reliable probe.
Step 2: splitting the file into parts
If ranges work, the manager divides the file into parts and gives each one to a worker. A 100 MB file with 16 workers becomes 16 ranges of about 6 MB. Each worker opens its own connection and sends something like Range: bytes=6291456-12582911.
Each worker writes the bytes it receives straight to the right position in a single pre-allocated file. Older tools downloaded each part to a separate temporary file and merged them at the end, which meant a long, disk-heavy "joining" step. Writing to the final offsets avoids that.
Step 3: dynamic splitting, the part people miss
Splitting evenly is not enough. Connections finish at different times, so the last few seconds of a naive download crawl along on one connection while the others sit idle.
Better managers split dynamically. When a worker finishes its part, it takes the second half of whichever part has the most bytes left, as long as both halves stay above a minimum size. The slowest tail is shared out among everyone, so the download finishes together instead of trickling to a stop.
Step 4: surviving a crash
Resume is the feature people value most and the one that is easiest to get subtly wrong. The manager must record, for every part, how many bytes have really landed on disk. TurboGet saves each part's position every 1.5 seconds in a local database, and flushes whatever is still in memory when you pause or cancel.
When you start the app again, it reads those positions, asks the server for only the missing ranges and carries on. Before it does, it checks the saved ETag or Last-Modified against the server. If the file changed in the meantime, it restarts cleanly. Stitching old bytes onto a new file would give you a corrupt download that looks complete.
When a download manager does not help
It is worth being honest about the limits:
- If the server refuses ranges, the manager falls back to one connection. Nothing is gained.
- If your line is the bottleneck, more connections do not create more bandwidth. A manager helps when the *server* limits each connection, which many servers and CDNs do.
- Too many connections can hurt. Some servers answer with HTTP 429 or 503 when you open too many, so a good manager backs off automatically.
In a controlled test against a server that capped each connection at 4 MB/s, a 100 MB file took 25.4 seconds on one connection and 2.0 seconds on sixteen. That is the best case: a per-connection cap with plenty of line to spare.
Frequently asked questions
Does a download manager make my internet faster?
No. It uses your existing bandwidth more fully. If a server limits each connection, several connections together can reach speeds one connection cannot. If your line is already saturated, there is nothing to gain.
Is downloading in parts safe for the file?
Yes, when it is done properly. Each part is written to its own offset, and a checksum of the finished file will match the original. Good managers also verify that the file on the server has not changed before resuming.
What happens if the server does not support resume?
The manager downloads over a single connection and cannot continue after an interruption. Many large-file hosts and CDNs do support ranges, but small dynamic pages and some download portals do not.
TurboGet is the free Windows download manager I built using exactly these ideas.
See TurboGet