{"type":"rich","version":"1.0","provider_name":"Transistor","provider_url":"https://transistor.fm","author_name":"Programming Tech Brief By HackerNoon","title":"Streaming ZIP Archives On the Fly With nginx + mod_zip: No Disk, No Buffers, No Problem","html":"<iframe width=\"100%\" height=\"180\" frameborder=\"no\" scrolling=\"no\" seamless src=\"https://share.transistor.fm/e/b33dc0b0\"></iframe>","width":"100%","height":180,"duration":813,"description":"\n        This story was originally published on HackerNoon at: https://hackernoon.com/streaming-zip-archives-on-the-fly-with-nginx-mod_zip-no-disk-no-buffers-no-problem.\n             How we stream ZIP archives on the fly at scale using nginx + mod_zip — no disk writes, no buffering, with local and remote files in a single archive. \n            Check more stories related to programming at: https://hackernoon.com/c/programming.\n            You can also check exclusive content about #nginx, #zip, #php, #architecture, #performance, #file-handling, #backend, #hackernoon-top-story,  and more.\n            \n            \n            This story was written by: @dmitriistarikov. Learn more about this writer by checking @dmitriistarikov's about page,\n            and for more stories, please visit hackernoon.com.\n            \n                \n                \n                Instead of downloading files to disk, computing checksums, and building a ZIP before serving it, we use nginx + mod_zip to stream archives directly to the client. PHP returns a short manifest listing file URLs and sizes — nginx fetches each file via internal subrequests and pumps them into a ZIP stream in real time. No temp files, no buffering, no waiting. The main gotcha: file sizes are required upfront (ZIP format constraint), which is trivial for local files and requires a HEAD request for remote ones. We hit a production incident caused by zero sizes in metadata from an external team — silent broken archives, hard to debug because mod_zip subrequests don't surface in normal log pipelines.\n        \n        ","thumbnail_url":"https://img.transistorcdn.com/KhCapPSRkLGL2Xw8888yuChkNRWthaKapLYTvNdu4W4/rs:fill:0:0:1/w:400/h:400/q:60/mb:500000/aHR0cHM6Ly9pbWct/dXBsb2FkLXByb2R1/Y3Rpb24udHJhbnNp/c3Rvci5mbS9zaG93/LzQxMTY2LzE2ODM1/ODIzMzAtYXJ0d29y/ay5qcGc.webp","thumbnail_width":300,"thumbnail_height":300}