Resume Downloads Through Squid
Check Range responses and object identity before resuming a file, and distinguish Squid's prefetch policy from basic Range support.
Use continuation only when download.part belongs to the same object representation you will request now. A filename alone cannot establish that: the origin may have changed the content since the first attempt.
curl --proxy http://proxy.example:3128 --noproxy '' --connect-timeout 5 --max-time 60 -C - --output download.part http://files.example/test.binReplace both endpoints with services you are authorized to use. For a public-file comparison where public proxies are permitted, take an HTTP endpoint from the HTTP proxy list. -C - uses the existing file's size as the continuation point. Inspect the destination's response rather than treating any returned body as the missing bytes:
| Response | Interpretation |
|---|---|
| 206 with Content-Range | Check that the returned range is the expected continuation. |
| 200 | The server may have ignored Range and sent the full representation. |
| 416 | The requested range is unsatisfiable; do not append the error page. |
Validators and If-Range can help avoid joining versions of a changing resource. Follow the application's representation rules before trusting the completed file.
Squid 6.13's range_offset_limit governs when it fetches an object from the beginning for caching, not whether a client may request a range:
range_offset_limit 0A zero limit avoids extra prefix fetching merely to populate the cache. Forwarding a useful range without caching the object can still be successful. For ordinary HTTPS CONNECT, the Range exchange is inside destination TLS; read that destination response instead of treating Squid's visible object-cache policy as control of the inner request.