Re:Python – Writing large ZIP archives without memory inflation
by herpderperator on Saturday November 20, 2021 @06:13PM
(#29292650)
I don't think they literally mean "for immediate sending out to clients" right? Because that would block the worker thread for the duration of the download. It makes more sense to write the output to disk and serve it out as normal static content.
[ Parent
| on HN ]
Re:Python – Writing large ZIP archives without memory inflation
by thrashh on Saturday November 20, 2021 @06:24PM
(#29292716)
It would only block if you did it synchronously.
If I had to build an endpoint that generated ZIPs on the fly, I would explicitly build it to be asynchronous and efficient as possible.
The only issue is that you might want to attach a buffer somewhere that might dump to disk past a certain amount, if the source of your data can’t be “paused.”