<p>We have a project page which consists of users' files, multimedia stuff, etc and we want to allow the user to export all this out into a single zip file. We're using unix and mysql to store all of these currently and our primary goal is to minimize load/performance time from all the processing and compiling all the files into a zip file.</p>

<p>My idea was to cache the zip file into a temp dir and keep all the CRC checksum for each files in the zip into a separate text file. Each time the user tries to do an export I will first check through each file's CRC and compare it to the list before adding or removing files from the zip file.</p>

<p>But my other concern is also the space that the zip file will be occupying as we might have a lot of users.</p>

<p>IMHO, this is probably the dumbest way possible to do this,
so can any of you guys please suggest a better way to deal with this problem?</p>

<p>thanks
~codeNoobian</p>

If bandwidth/download speed is not a concern, I recommend you use an uncompressed tar file. TAR is a very simple format, so it will be easy to write code to update sections of it when a few of the files have changed.  Also, leaving it uncompressed will be a huge win on server CPU time.
Of course, leaving it uncompressed will take a lot of storage space on your server.  But since it is uncompressed, it might remove the need for you to keep a cache copy of the file at all, if you can build it fast enough you can just build it on the fly as needed.  Then you don't have to worry about storing CRCs and updating the TAR, either.