httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@ai.mit.edu (Robert S. Thau)
Subject Re: Content-type negotiation: thoughts and code
Date Thu, 16 Mar 1995 18:28:57 GMT
   Date: Thu, 16 Mar 95 22:25 GMT
   From: drtr@ast.cam.ac.uk (David Robinson)

   It may not make it easier to write, but it's one less thing for the user
   to understand.

It's new syntax either way.  Besides, Roy's meta/http is at least
pretty straightforward ---

   URI: foo.en.gif
   Content-type: image/gif; qs = 0.7
   Content-language: en

is pretty hard to screw up.

   In fact, what I was getting at was this; suppose I want
   to do a server-side include of a document subject to content-negotiation.

Oy.  <!--#includes--> of mapped entities was something I hadn't even
considered.  But there is an immediately obvious application for it,
now that you mention it: documents with tables --- (keep one version
of most of it, but <!--#include--> the tables, and use mapping to
choose either real HTML3 tables or a <pre>formatted version).

This requires heavy work on send_included_file in http_includes.c.

   In the near future (when we have some working patches), you would
   have to <!--#include--> another document that was a mapfile. What I
   was hoping for in the long term was for the shtml file to be able
   to do content-negotiated includes directly. So that map files would
   be a sub-set of general shtml files.

I'm not sure that this is wise in all cases --- if the same varied
entity is #included multiple times, it sounds like it would be a real
hassle to update the N different maps in the N different files that
include it.

In any case, there are some *nasty* subtleties here.  Say we have a
variant entity whose variant forms are, say, GIF, JPEG, and text/plain
(ASCII-art).  Right now, when the server retrieves a .shtml file, it
goes through processing <!--#directives-->, and sending all other
bytes over the wire.  If there is any extraneous whitespace at all in
the pseudo-.shtml "map" file (let alone, say, comments!) then that
too will be sent over the wire, corrupting the binary formats.

Another problem is how the server is supposed to know that it should
wait to read the <!--#directives--> before deciding what the MIME type
of this thing is, rather than doing what it usually does with *.shtml,
which is deciding that the thing is text/html, sending an appropriate
header, and only then starting to process the contents.

Maybe I'm slow, but I don't see how to deal with either of these
problems without having the server know, somehow, that maps are to be
treated differently from ordinary *.shtml files --- and after that,
I'm not sure that I see any compelling reason to keep the same syntax.

rst

Mime
View raw message