[Xapian-discuss] zip/rar support

Olly Betts olly at survex.com
Sun Aug 27 16:29:47 BST 2006


On Sun, Aug 27, 2006 at 04:10:36PM +0100, James Aylett wrote:
> On Sun, Aug 27, 2006 at 02:08:30PM +0200, Reini Urban wrote:
> 
> > Yes. This extra script (a php file) checks the cache and sends the 
> > already extracted part to the browser, and if it not exists in the cache 
> > extracts it on the fly from the url to the browser.
> 
> I'm pretty certain I've seen an apache module that does this with the
> simplest possible URI layout:
> 
> /path/to/archive/path/to/packed/file

This looks like what you mean:

http://nobits.org/articles/2005/10/12/mod-unzip/

That webpage points out the zip files are indexed so accesses are
pretty fast - I suspect they're right and caching probably isn't worth
the effort for the contents of zip files unless your web server is CPU
bound and has I/O to burn.

> If not, with apache at least you could write it in PHP, Python or
> Perl, without needing to pre-unpack the archive. Adding in caching
> isn't terribly difficult.

I think this is a good approach, since it doesn't rely on a particular
script being installed in a particular location, and it degrades
reasonably gracefully if there's no handler installed to run mod_unzip
(or something equivalent) - in that case the web server will ignore the
extra path information and just download the whole zip file.  That's
much better than a 404 error.

We should be able to use the same approach for any "container" filetype
though the appropriate apache module or other handler script may not
already exist.

Cheers,
    Olly



More information about the Xapian-discuss mailing list