> The correct behavior would be to send the compressed data along to the
> browser without touching it, while setting the Transfer-Encoding HTTP
> header to gzip. If the browser is incapable of handling that
> Transfer-Encoding then you can unzip it yourself and send it along.
That's the right way if you're writing a browser-centric metadata system.
However, the web is only one of the possible interfaces. What you're
proposing would break all existing clients whenever this feature is used
just so that things would be the most natural for the one client that also
integrates with a web browser. I see no value in doing it the way which is
most natural for integrating with a web browser.
The right way to do it is to make automatic zipping/unzipping orthogonal
to the content-handling/displaying system, which might be a web browser,
or might be something else, and shouldn't depend on clients to emulate web
browsers and shouldn't break existing clients.
So the right way to do it is to add a module to FProxy (and any other
clients whose authors are interested) which automatically zips/unzips
certain files. Then we can leave the metadata alone and not break old
clients and not require clients to act like browsers.
> But how are you supposed to reliably determine the Content-Type to
> send to the browser if we're sticking application/x-gzip in our
> ContentType Info field? Filename guessing is not sufficient..
Obviously if the clients are by convention automatically zipping/unzipping
files then they will by convention store the MIME type of the zipped file
in the generated zip file. So when the autozip-aware client sees a zip
file it unzips it (if autounzip is turned on). If the file contains a file
called CONTENT-TYPE then it reads the content type from it, sets the
ContentType field in the metadata, and sends the contained file along as
the data. If no such file exists, then it can either 1) use filename
guessing if configured to do so, or 2) give up since this is just a normal
zip file and not an autozipped file. Of course if filename guessing is
turned on it will work with normal zip files as well. However, if there is
no content type and file name guessing is off then the only reasonable
thing to do is to give up and pass the zip on as a zip.
This scheme will actually work with clients which are totally naive to
autozipping. You can put the CONTENT-TYPE filed in a zip file yourself or
turn on filename guessing. Or you can just download straight zip files and
unzip them yourself.
> Let's do this the right way.
Definitely.
_______________________________________________
Devl mailing list
[EMAIL PROTECTED]
http://lists.freenetproject.org/mailman/listinfo/devl