evanmiller / mod_zip

Streaming ZIP archiver for nginx 📦
https://www.nginx.com/resources/wiki/modules/zip/
BSD 3-Clause "New" or "Revised" License
215 stars 64 forks source link

Handling of client disconnects #82

Open mecampbellsoup opened 3 years ago

mecampbellsoup commented 3 years ago

Hey @evanmiller! Hope you are doing well man. mod_zip is generally working great for us :)

I have a question that may or may not be related to mod_zip specifically.

In short, in our application we stream large (10+ GB) file/directory downloads to our users. Often times they are in places with unreliable internet connections. It seems that when there is some service interruption, these long-running downloads get interrupted and cannot resume where they left off.

Could we use Last-Modified to pick up where the download left off?

To save bandwidth, add a "Last-Modified" header in the upstream response; mod_zip will then honor the "If-Range" header from clients.

evanmiller commented 3 years ago

Yes, adding Last-Modified should allow clients to resume failed downloads.

mecampbellsoup commented 3 years ago

@evanmiller why/are CRC32 calculations for each entry in the manifest required to support this feature? It's not immediately clear to my why that would be... if there's some documentation floating around (I haven't found a good explanation) that you're aware of I'd appreciate linking it here! Thanks 🙏