bottleneck testcase based on rubbos
[bottlenecks.git] / rubbos / app / apache2 / manual / mod / mod_negotiation.html.en
1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!--
4         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
5               This file is generated from xml source: DO NOT EDIT
6         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
7       -->
8 <title>mod_negotiation - Apache HTTP Server</title>
9 <link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
10 <link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
11 <link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" />
12 <link href="../images/favicon.ico" rel="shortcut icon" /></head>
13 <body>
14 <div id="page-header">
15 <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p>
16 <p class="apache">Apache HTTP Server Version 2.0</p>
17 <img alt="" src="../images/feather.gif" /></div>
18 <div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="../images/left.gif" /></a></div>
19 <div id="path">
20 <a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs/">Documentation</a> &gt; <a href="../">Version 2.0</a> &gt; <a href="./">Modules</a></div>
21 <div id="page-content">
22 <div id="preamble"><h1>Apache Module mod_negotiation</h1>
23 <div class="toplang">
24 <p><span>Available Languages: </span><a href="../en/mod/mod_negotiation.html" title="English">&nbsp;en&nbsp;</a> |
25 <a href="../ja/mod/mod_negotiation.html" hreflang="ja" rel="alternate" title="Japanese">&nbsp;ja&nbsp;</a></p>
26 </div>
27 <table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>Provides for <a href="../content-negotiation.html">content negotiation</a></td></tr>
28 <tr><th><a href="module-dict.html#Status">Status:</a></th><td>Base</td></tr>
29 <tr><th><a href="module-dict.html#ModuleIdentifier">Module Identifier:</a></th><td>negotiation_module</td></tr>
30 <tr><th><a href="module-dict.html#SourceFile">Source File:</a></th><td>mod_negotiation.c</td></tr></table>
31 <h3>Summary</h3>
32
33     <p>Content negotiation, or more accurately content selection, is
34     the selection of the document that best matches the clients
35     capabilities, from one of several available documents. There
36     are two implementations of this.</p>
37
38     <ul>
39       <li>A type map (a file with the handler
40       <code>type-map</code>) which explicitly lists the files
41       containing the variants.</li>
42
43       <li>A MultiViews search (enabled by the <code>MultiViews</code>
44       <code class="directive"><a href="../mod/core.html#options">Options</a></code>), where the server does
45       an implicit filename pattern match, and choose from amongst the
46       results.</li>
47     </ul>
48 </div>
49 <div id="quickview"><h3 class="directives">Directives</h3>
50 <ul id="toc">
51 <li><img alt="" src="../images/down.gif" /> <a href="#cachenegotiateddocs">CacheNegotiatedDocs</a></li>
52 <li><img alt="" src="../images/down.gif" /> <a href="#forcelanguagepriority">ForceLanguagePriority</a></li>
53 <li><img alt="" src="../images/down.gif" /> <a href="#languagepriority">LanguagePriority</a></li>
54 </ul>
55 <h3>Topics</h3>
56 <ul id="topics">
57 <li><img alt="" src="../images/down.gif" /> <a href="#typemaps">Type maps</a></li>
58 <li><img alt="" src="../images/down.gif" /> <a href="#multiviews">MultiViews</a></li>
59 </ul><h3>See also</h3>
60 <ul class="seealso">
61 <li><code class="directive"><a href="../mod/core.html#options">Options</a></code></li>
62 <li><code class="module"><a href="../mod/mod_mime.html">mod_mime</a></code></li>
63 <li><a href="../content-negotiation.html">Content
64 Negotiation</a></li>
65 <li><a href="../env.html">Environment Variables</a></li>
66 </ul></div>
67 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
68 <div class="section">
69 <h2><a name="typemaps" id="typemaps">Type maps</a></h2>
70     <p>A type map has a format similar to RFC822 mail headers. It
71     contains document descriptions separated by blank lines, with
72     lines beginning with a hash character ('#') treated as
73     comments. A document description consists of several header
74     records; records may be continued on multiple lines if the
75     continuation lines start with spaces. The leading space will be
76     deleted and the lines concatenated. A header record consists of
77     a keyword name, which always ends in a colon, followed by a
78     value. Whitespace is allowed between the header name and value,
79     and between the tokens of value. The headers allowed are: </p>
80
81     <dl>
82       <dt><code>Content-Encoding:</code></dt>
83       <dd>The encoding of the file. Apache only recognizes
84       encodings that are defined by an <code class="directive"><a href="../mod/mod_mime.html#addencoding">AddEncoding</a></code> directive.
85       This normally includes the encodings <code>x-compress</code>
86       for compress'd files, and <code>x-gzip</code> for gzip'd
87       files. The <code>x-</code> prefix is ignored for encoding
88       comparisons.</dd>
89
90       <dt><code>Content-Language:</code></dt>
91       <dd>The language(s) of the variant, as an Internet standard
92       language tag (<a href="http://www.ietf.org/rfc/rfc1766.txt">RFC 1766</a>). An example is <code>en</code>,
93       meaning English. If the variant contains more than one
94       language, they are separated by a comma.</dd>
95
96       <dt><code>Content-Length:</code></dt>
97       <dd>The length of the file, in bytes. If this header is not
98       present, then the actual length of the file is used.</dd>
99
100       <dt><code>Content-Type:</code></dt>
101
102       <dd>
103         The MIME media type of the document, with optional
104         parameters. Parameters are separated from the media type
105         and from one another by a semi-colon, with a syntax of
106         <code>name=value</code>. Common parameters include: 
107
108         <dl>
109           <dt><code>level</code></dt>
110           <dd>an integer specifying the version of the media type.
111           For <code>text/html</code> this defaults to 2, otherwise
112           0.</dd>
113
114           <dt><code>qs</code></dt>
115           <dd>a floating-point number with a value in the range 0.0
116           to 1.0, indicating the relative 'quality' of this variant
117           compared to the other available variants, independent of
118           the client's capabilities. For example, a jpeg file is
119           usually of higher source quality than an ascii file if it
120           is attempting to represent a photograph. However, if the
121           resource being represented is ascii art, then an ascii
122           file would have a higher source quality than a jpeg file.
123           All <code>qs</code> values are therefore specific to a given
124           resource.</dd>
125         </dl>
126
127         <div class="example"><h3>Example</h3><p><code>
128           Content-Type: image/jpeg; qs=0.8
129         </code></p></div>
130       </dd>
131
132       <dt><code>URI:</code></dt>
133       <dd>uri of the file containing the variant (of the given
134       media type, encoded with the given content encoding). These
135       are interpreted as URLs relative to the map file; they must
136       be on the same server (!), and they must refer to files to
137       which the client would be granted access if they were to be
138       requested directly.</dd>
139
140       <dt><code>Body:</code></dt>
141       <dd>New in Apache 2.0, the actual content of the resource may
142       be included in the type-map file using the Body header.  This
143       header must contain a string that designates a delimiter for
144       the body content. Then all following lines in the type map
145       file will be considered part of the resource body until the
146       delimiter string is found.
147
148       <div class="example"><h3>Example:</h3><p><code>
149         Body:----xyz----<br />
150         &lt;html&gt;<br />
151         &lt;body&gt;<br />
152         &lt;p&gt;Content of the page.&lt;/p&gt;<br />
153         &lt;/body&gt;<br />
154         &lt;/html&gt;<br />
155         ----xyz----
156       </code></p></div>
157       </dd>
158     </dl>
159 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
160 <div class="section">
161 <h2><a name="multiviews" id="multiviews">MultiViews</a></h2>
162     <p>A MultiViews search is enabled by the <code>MultiViews</code>
163     <code class="directive"><a href="../mod/core.html#options">Options</a></code>. If the server receives a
164     request for <code>/some/dir/foo</code> and
165     <code>/some/dir/foo</code> does <em>not</em> exist, then the
166     server reads the directory looking for all files named
167     <code>foo.*</code>, and effectively fakes up a type map which
168     names all those files, assigning them the same media types and
169     content-encodings it would have if the client had asked for one
170     of them by name. It then chooses the best match to the client's
171     requirements, and returns that document.</p>
172
173     <p>The <code class="directive"><a href="../mod/mod_mime.html#multiviewsmatch">MultiViewsMatch</a></code>
174     directive configures whether Apache will consider files
175     that do not have content negotiation meta-information assigned
176     to them when choosing files.</p>
177 </div>
178 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
179 <div class="directive-section"><h2><a name="CacheNegotiatedDocs" id="CacheNegotiatedDocs">CacheNegotiatedDocs</a> <a name="cachenegotiateddocs" id="cachenegotiateddocs">Directive</a></h2>
180 <table class="directive">
181 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Allows content-negotiated documents to be 
182 cached by proxy servers</td></tr>
183 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>CacheNegotiatedDocs On|Off</code></td></tr>
184 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>CacheNegotiatedDocs Off</code></td></tr>
185 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
186 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
187 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_negotiation</td></tr>
188 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>The syntax changed in version 2.0.</td></tr>
189 </table>
190     <p>If set, this directive allows content-negotiated documents
191     to be cached by proxy servers. This could mean that clients
192     behind those proxys could retrieve versions of the documents
193     that are not the best match for their abilities, but it will
194     make caching more efficient.</p>
195
196     <p>This directive only applies to requests which come from
197     HTTP/1.0 browsers. HTTP/1.1 provides much better control over
198     the caching of negotiated documents, and this directive has no
199     effect in responses to HTTP/1.1 requests.</p>
200
201     <p>Prior to version 2.0,
202     <code class="directive">CacheNegotiatedDocs</code> did not take an
203     argument; it was turned on by the presence of the directive by
204     itself.</p>
205
206 </div>
207 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
208 <div class="directive-section"><h2><a name="ForceLanguagePriority" id="ForceLanguagePriority">ForceLanguagePriority</a> <a name="forcelanguagepriority" id="forcelanguagepriority">Directive</a></h2>
209 <table class="directive">
210 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Action to take if a single acceptable document is not 
211 found</td></tr>
212 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ForceLanguagePriority None|Prefer|Fallback [Prefer|Fallback]</code></td></tr>
213 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ForceLanguagePriority Prefer</code></td></tr>
214 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
215 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
216 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
217 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_negotiation</td></tr>
218 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in version 2.0.30 and later</td></tr>
219 </table>
220     <p>The <code class="directive">ForceLanguagePriority</code> directive uses
221     the given <code class="directive"><a href="#languagepriority">LanguagePriority</a></code> to satisfy
222     negotation where the server could otherwise not return a single
223     matching document.</p>
224
225     <p><code>ForceLanguagePriority Prefer</code> uses
226     <code>LanguagePriority</code> to serve a one valid result, rather
227     than returning an HTTP result 300 (MULTIPLE CHOICES) when there
228     are several equally valid choices.  If the directives below were
229     given, and the user's <code>Accept-Language</code> header assigned
230     <code>en</code> and <code>de</code> each as quality <code>.500</code>
231     (equally acceptable) then the first matching variant, <code>en</code>,
232     will be served.</p>
233
234     <div class="example"><p><code>
235       LanguagePriority en fr de<br />
236       ForceLanguagePriority Prefer
237     </code></p></div>
238
239     <p><code>ForceLanguagePriority Fallback</code> uses
240     <code class="directive"><a href="#languagepriority">LanguagePriority</a></code> to
241     serve a valid result, rather than returning an HTTP result 406
242     (NOT ACCEPTABLE). If the directives below were given, and the user's
243     <code>Accept-Language</code> only permitted an <code>es</code>
244     language response, but such a variant isn't found, then the first
245     variant from the <code class="directive"><a href="#languagepriority">LanguagePriority</a></code> list below will be served.</p>
246
247     <div class="example"><p><code>
248       LanguagePriority en fr de<br />
249       ForceLanguagePriority Fallback
250     </code></p></div>
251
252     <p>Both options, <code>Prefer</code> and <code>Fallback</code>, may be
253     specified, so either the first matching variant from <code class="directive"><a href="#languagepriority">LanguagePriority</a></code> will be served if
254     more than one variant is acceptable, or first available document will
255     be served if none of the variants matched the client's acceptable list
256     of languages.</p>
257
258 <h3>See also</h3>
259 <ul>
260 <li><code class="directive"><a href="../mod/mod_mime.html#addlanguage">AddLanguage</a></code></li>
261 </ul>
262 </div>
263 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
264 <div class="directive-section"><h2><a name="LanguagePriority" id="LanguagePriority">LanguagePriority</a> <a name="languagepriority" id="languagepriority">Directive</a></h2>
265 <table class="directive">
266 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>The precendence of language variants for cases where
267 the client does not express a preference</td></tr>
268 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>LanguagePriority <var>MIME-lang</var> [<var>MIME-lang</var>]
269 ...</code></td></tr>
270 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
271 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
272 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
273 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_negotiation</td></tr>
274 </table>
275     <p>The <code class="directive">LanguagePriority</code> sets the precedence
276     of language variants for the case where the client does not
277     express a preference, when handling a MultiViews request. The list
278     of <var>MIME-lang</var> are in order of decreasing preference.</p>
279
280     <div class="example"><h3>Example:</h3><p><code>
281       LanguagePriority en fr de
282     </code></p></div>
283
284     <p>For a request for <code>foo.html</code>, where
285     <code>foo.html.fr</code> and <code>foo.html.de</code> both
286     existed, but the browser did not express a language preference,
287     then <code>foo.html.fr</code> would be returned.</p>
288
289     <p>Note that this directive only has an effect if a 'best'
290     language cannot be determined by any other means or the <code class="directive"><a href="#forcelanguagepriority">ForceLanguagePriority</a></code> directive
291     is not <code>None</code>. In general, the client determines the
292     language preference, not the server.</p>
293
294 <h3>See also</h3>
295 <ul>
296 <li><code class="directive"><a href="../mod/mod_mime.html#addlanguage">AddLanguage</a></code></li>
297 </ul>
298 </div>
299 </div>
300 <div class="bottomlang">
301 <p><span>Available Languages: </span><a href="../en/mod/mod_negotiation.html" title="English">&nbsp;en&nbsp;</a> |
302 <a href="../ja/mod/mod_negotiation.html" hreflang="ja" rel="alternate" title="Japanese">&nbsp;ja&nbsp;</a></p>
303 </div><div id="footer">
304 <p class="apache">Copyright 2009 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
305 <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div>
306 </body></html>