http://www.perlmonks.org?node_id=136532


in reply to Serving tarball contents as part of your webspace (impractical but fun)

One of your main problems is that the gzip format means that you have to decompress the whole tar file in order to get any particular one out of it.

I would expect far better performance if you gzipped the individual files and then tarred the bundle rather than doing it the other way. This isn't usually done because it results in less overall compression. But it means that any particular file can be extracted relatively easily.

Also note that you could improve performance even more by just losing the idea of having a tar. But if you do that then you need to be very, very careful about security else someone will be able to access any gzipped file on your webserver.