We are creating a web service where you can upload a zip file (sometimes pretty large 100MB to 1GB) whose contents will then be served via http.
Contents are served with static gzip compression. As I understand gzip is essentially some headers + deflate. Zip is also some meta-info + multiple optionally compressed streams some of which usually are also deflate.
I am concerned that we are doing unnecessary round trip there. Unpack zip - then compress every file with gzip. In theory we could just slice zip in deflate chunks, add some headers and voila we have .gzip compressed files without doing actual compression, yet it sounds like something that someone else already did. So my question is:
Is there some command line tool for Linux or library for Ruby/Node.js/C++ that given a .zip file will create a folder with it's contents along with .gzipped versions of those contents without doing unnecessary recompression?
zip2gz
on a whim. Sure enough, there is such a python snippet at github.com/patrikaxelsson/zip2gz, though I can't judge the technical merits (and did not even attempt to). – dxiv