]> granicus.if.org Git - apache/commitdiff
Added a little more detail to the docs based on some comments from Bill
authorRich Bowen <rbowen@apache.org>
Mon, 3 Sep 2001 03:45:27 +0000 (03:45 +0000)
committerRich Bowen <rbowen@apache.org>
Mon, 3 Sep 2001 03:45:27 +0000 (03:45 +0000)
Rowe. More to come, but this clarified a point that I had to track
down earlier, and may save someone some time.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90878 13f79535-47bb-0310-9956-ffa450edef68

docs/manual/content-negotiation.html
docs/manual/content-negotiation.html.en

index d1b4ab20abcc38d7dd89e3cbb8b2f3f815a70b00..a813fcf8c949a9665aee09705ad1bfb0273ac64c 100644 (file)
@@ -114,16 +114,17 @@ file suffix as <CODE>type-map</CODE>; this is best done with a
   AddHandler type-map .var
 </PRE>
 
-in the server configuration file.  See the comments in the sample config
-file for more details. <P>
+in the server configuration file.<p>
 
-Type map files have an entry for each available variant; these entries
+Type map files should have the same name as the resource which they are
+describing, and have an entry for each available variant; these entries
 consist of contiguous HTTP-format header lines.  Entries for
 different variants are separated by blank lines.  Blank lines are
 illegal within an entry.  It is conventional to begin a map file with
 an entry for the combined entity as a whole (although this
 is not required, and if present will be ignored). An example
-map file is:
+map file is shown below. This file would be named <code>foo.html</code>,
+as it describes a resource named <code>foo</code>.
 
 <PRE>
   URI: foo
@@ -137,6 +138,9 @@ map file is:
   Content-language: fr, de
 </PRE>
 
+Note also that a typemap file will take precedence over the filename's
+extension, even when Multiviews is on.
+
 If the variants have different source qualities, that may be indicated
 by the "qs" parameter to the media type, as in this picture (available
 as jpeg, gif, or ASCII-art):
@@ -196,7 +200,7 @@ The full list of headers recognized is:
        for compress'd files, and <CODE>x-gzip</CODE> for gzip'd files.
        The <CODE>x-</CODE> prefix is ignored for encoding comparisons.
   <DT> <CODE>Content-Length:</CODE>
-  <DD> The size of the file.  Specifying content
+  <DD> The size of the file in bytes.  Specifying content
        lengths in the type-map allows the server to compare file sizes
        without checking the actual files.
   <DT> <CODE>Description:</CODE>
@@ -206,6 +210,11 @@ The full list of headers recognized is:
        list will include the human-readable variant descriptions.
 </DL>
 
+Using a type map file is preferred over <code>MultiViews</code> because
+it requires less CPU time, and less file access, to parse a file
+explicitly listing the various resource variants, than to have to look
+at every matching file, and parse its file extensions.
+
 <H3>Multiviews</H3>
 
 <P>
@@ -485,7 +494,8 @@ quality factors to 5 decimal places before choosing the best variant.
 If you are using language negotiation you can choose between
 different naming conventions, because files can have more than one
 extension, and the order of the extensions is normally irrelevant
-(see <A HREF="mod/mod_mime.html">mod_mime</A> documentation for details).
+(see the <A HREF="mod/mod_mime.html#multipleext">mod_mime</A>
+documentation for details).
 <P>
 A typical file has a MIME-type extension (<EM>e.g.</EM>, <SAMP>html</SAMP>),
 maybe an encoding extension (<EM>e.g.</EM>, <SAMP>gz</SAMP>), and of course a
index d1b4ab20abcc38d7dd89e3cbb8b2f3f815a70b00..a813fcf8c949a9665aee09705ad1bfb0273ac64c 100644 (file)
@@ -114,16 +114,17 @@ file suffix as <CODE>type-map</CODE>; this is best done with a
   AddHandler type-map .var
 </PRE>
 
-in the server configuration file.  See the comments in the sample config
-file for more details. <P>
+in the server configuration file.<p>
 
-Type map files have an entry for each available variant; these entries
+Type map files should have the same name as the resource which they are
+describing, and have an entry for each available variant; these entries
 consist of contiguous HTTP-format header lines.  Entries for
 different variants are separated by blank lines.  Blank lines are
 illegal within an entry.  It is conventional to begin a map file with
 an entry for the combined entity as a whole (although this
 is not required, and if present will be ignored). An example
-map file is:
+map file is shown below. This file would be named <code>foo.html</code>,
+as it describes a resource named <code>foo</code>.
 
 <PRE>
   URI: foo
@@ -137,6 +138,9 @@ map file is:
   Content-language: fr, de
 </PRE>
 
+Note also that a typemap file will take precedence over the filename's
+extension, even when Multiviews is on.
+
 If the variants have different source qualities, that may be indicated
 by the "qs" parameter to the media type, as in this picture (available
 as jpeg, gif, or ASCII-art):
@@ -196,7 +200,7 @@ The full list of headers recognized is:
        for compress'd files, and <CODE>x-gzip</CODE> for gzip'd files.
        The <CODE>x-</CODE> prefix is ignored for encoding comparisons.
   <DT> <CODE>Content-Length:</CODE>
-  <DD> The size of the file.  Specifying content
+  <DD> The size of the file in bytes.  Specifying content
        lengths in the type-map allows the server to compare file sizes
        without checking the actual files.
   <DT> <CODE>Description:</CODE>
@@ -206,6 +210,11 @@ The full list of headers recognized is:
        list will include the human-readable variant descriptions.
 </DL>
 
+Using a type map file is preferred over <code>MultiViews</code> because
+it requires less CPU time, and less file access, to parse a file
+explicitly listing the various resource variants, than to have to look
+at every matching file, and parse its file extensions.
+
 <H3>Multiviews</H3>
 
 <P>
@@ -485,7 +494,8 @@ quality factors to 5 decimal places before choosing the best variant.
 If you are using language negotiation you can choose between
 different naming conventions, because files can have more than one
 extension, and the order of the extensions is normally irrelevant
-(see <A HREF="mod/mod_mime.html">mod_mime</A> documentation for details).
+(see the <A HREF="mod/mod_mime.html#multipleext">mod_mime</A>
+documentation for details).
 <P>
 A typical file has a MIME-type extension (<EM>e.g.</EM>, <SAMP>html</SAMP>),
 maybe an encoding extension (<EM>e.g.</EM>, <SAMP>gz</SAMP>), and of course a