User download of entire gallery

We have request form customer to enable download of entire gallery (as a single zip). Anybody tried this? It seems to be quite simple write snippet that zips directory content of that gallery to a temp file and return link (using ajax). But there need to be some kind of garbage collection of long time unused zips, on the other side reuse already created zips. Any ideas?