I am creating a zip archive on the fly of unknown length from existing material (using Node), which is already compressed. Files are simply saved in the ZIP archive; ZIP is used for only one container. Therefore, caching the created ZIP files does not make sense - there is no real calculation.
Bye, OK. Now I want to allow resuming downloads , and I'm reading about the Accept-Range, Range, and Content-Range HTTP headers. A client with a broken download will request an open range, say: Range: bytes=8000000- .
How do I answer? My answer should include the Content-Range header, and there, according to RFC 2616 § 14.16 :
Unlike the values of range byte specifiers (see section 14.35.1), byte-range-resp-spec MUST specify only one range and MUST contain absolute byte positions for both the first and last byte of the range.
Therefore, I can’t just send “everything from position X”, I have to indicate the last byte sent either by sending only a part of a known size, or by calculating the length in advance. Both ideas do not suit me. Is there any other possibility?
source share