4 ms·
Lets say the whole file is 1000 bytes and each of the five chunks is 200 bytes. If 2 and 4 have failed, then the HEAD would return with a Range header like this
by j4_james 13y ago
Lets say the whole file is 1000 bytes and each of the five chunks is 200 bytes. If 2 and 4 have failed, then the HEAD would return with a Range header like this:
Range: bytes=0-199,400-599,800-999
The client would then know it had to resend bytes 200-399 and 600-799 (namely parts 2 and 4). If the chunks only partially failed (say 100 bytes of each chunk was received), the HEAD might even return something like this:
Range: bytes=0-299,400-699,800-999
So now the client knows it only has to resend bytes 300-399 and 700-799 (only the last 100 bytes of chunks 2 and 4).
Technically the Range header isn't valid in an HTTP response (something they are aware of), but conceptually I think the idea works fairly well.