ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzaie_5.4.0.1/rzaiemod_negotiation.htm

242 lines
15 KiB
HTML
Raw Normal View History

2024-04-02 14:02:31 +00:00
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="security" content="public" />
<meta name="Robots" content="index,follow" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
<meta name="DC.Type" content="topic" />
<meta name="DC.Title" content="Module mod_negotiation" />
<meta name="copyright" content="(C) Copyright IBM Corporation 2002,2006" />
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 2002,2006" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="rzaiemod_negotiation" />
<meta name="DC.Language" content="en-us" />
<!-- All rights reserved. Licensed Materials Property of IBM -->
<!-- US Government Users Restricted Rights -->
<!-- Use, duplication or disclosure restricted by -->
<!-- GSA ADP Schedule Contract with IBM Corp. -->
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
<link rel="stylesheet" type="text/css" href="./ic.css" />
<title>Module mod_negotiation</title>
</head>
<body id="rzaiemod_negotiation"><a name="rzaiemod_negotiation"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<!--Java sync-link--><h1 class="topictitle1">Module mod_negotiation</h1>
<div><div class="important"><span class="importanttitle">Important:</span> Information
for this topic supports the latest PTF levels for HTTP Server for i5/OS .
It is recommended that you install the latest PTFs to upgrade to the latest
level of the HTTP Server for i5/OS. Some of the topics documented here are
not available prior to this update. See <a href="http://www-03.ibm.com/servers/eserver/iseries/software/http/services/service.html" target="_blank">http://www.ibm.com/servers/eserver/iseries/software/http/services/service.htm</a> <img src="www.gif" alt="Link outside Information Center" /> for more information. </div>
<p><strong>Summary</strong></p>
<p>Content negotiation is the selection of the document that best matches
the clients capabilities from one of several available documents. There are
two implementations of content negotiation: </p>
<ul><li> A type-map (a file with the handler type-map) which explicitly lists
the files containing the variants.</li>
<li>A MultiViews search (enabled by the MultiViews <a href="rzaiemod_core.htm#options">Options</a>) where the server does an implicit filename pattern match
and makes a choice from the results. </li>
</ul>
<p>See <a href="rzaiecontent-negotiation.htm">Content negotiation for HTTP Server (powered by Apache)</a> for
more information.</p>
<p><strong>Type maps</strong></p>
<p>A type map has the same format as RFC822 mail headers. It contains document
descriptions separated by blank lines, with lines beginning with a pound sign
('#') are treated as comments. A document description consists of several
header records. Records may be continued on multiple lines if the continuation
lines start with spaces. The leading space will be deleted and the lines concatenated.
A header record consists of a keyword name, which always ends in a colon,
followed by a value. Whitespace is allowed between the header name and value,
and between the tokens of value. The headers allowed are: </p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" frame="border" border="1" rules="all"><thead align="left"><tr><th valign="top" id="d0e50">Header</th>
<th valign="top" id="d0e52">Description</th>
</tr>
</thead>
<tbody><tr><td valign="top" headers="d0e50 ">Content-Encoding </td>
<td valign="top" headers="d0e52 ">The encoding of the file. The server only recognizes
encoding that is defined by an AddEncoding directive. This normally includes
the encoding x-compress for compress'ed files, and x-gzip for gzip'ed files.
The x- prefix is ignored for encoding comparisons. </td>
</tr>
<tr><td valign="top" headers="d0e50 ">Content-Language </td>
<td valign="top" headers="d0e52 ">The language of the variant, as an Internet standard
language tag (RFC 1766). An example is en, meaning English. </td>
</tr>
<tr><td valign="top" headers="d0e50 ">Content-Length </td>
<td valign="top" headers="d0e52 ">The length of the file, in bytes. If this header is
not present, then the actual length of the file is used. </td>
</tr>
<tr><td valign="top" headers="d0e50 ">Content-Type </td>
<td valign="top" headers="d0e52 ">The MIME media type of the document, with optional parameters.
Parameters are separated from the media type and from one another by a semicolon,
with a syntax of name=value. Common parameters include: <dl><dt class="dlterm"><strong>Parameter One</strong>: <em>level </em></dt>
<dd><ul><li>The <em>level</em> parameter is an integer specifying the version of the
media type. For text/html, this defaults to '2', otherwise '0'. </li>
</ul>
</dd>
</dl>
<dl><dt class="dlterm"><strong>Parameter Two</strong>: <em>qs</em></dt>
<dd><ul><li>The <em>qs</em> parameter is a floating-point number with a value in the
range of '0.0' to '1.0', indicating the relative quality of this variant compared
to the other available variants, independent of the client's capabilities.
For example, a '.jpeg' file is usually of higher source quality than an '.ascii'
file it is attempting to represent a photograph. However, if the resource
being represents is ASCII art, then an ASCII file would have a higher source
quality than a '.jpeg' file. All Qs values therefore specific to a given source.
For example: <pre>Content-Type: image/jpeg; Qs=0.8</pre>
</li>
</ul>
</dd>
</dl>
</td>
</tr>
<tr><td valign="top" headers="d0e50 ">URL </td>
<td valign="top" headers="d0e52 ">The path to the file containing this variant, relative
to the map file. </td>
</tr>
</tbody>
</table>
</div>
<p><strong>MultiViews</strong></p>
<p>A MultiViews search is enabled by the MultiViews Option. If the server
receives a request for /some/dir/QIBM and /some/dir/QIBM does not exist, then
the server reads the directory looking for all files named QIBM.* , and effectively
makes up a type map which names all those files, assigning them the same media
types and content-encodings it would have if the client had asked for one
of them by name. It then chooses the best match to the client's requirements,
and returns that document. </p>
<p><strong>Directives</strong></p>
<ul><li><a href="#cachenegotiateddocs">CacheNegotiatedDocs</a></li>
<li><a href="#forcelanguagepriority">ForceLanguagePriority</a></li>
<li><a href="#languagepriority">LanguagePriority</a></li>
</ul>
</div>
<div class="hr" id="cachenegotiateddocs"><a name="cachenegotiateddocs"><!-- --></a><h2 class="topictitle2">CacheNegotiatedDocs</h2>
<div>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" frame="void" border="0" rules="none"><tbody><tr><td colspan="2" valign="top"><strong><a href="rzaiedirective-dict.htm#rzaiedirective-dict__Module">Module</a></strong>: mod_negotiation </td>
</tr>
<tr><td colspan="2" valign="top"><strong><a href="rzaiedirective-dict.htm#rzaiedirective-dict__Syntax">Syntax</a></strong>: CacheNegotiatedDocs <em>on | off </em></td>
</tr>
<tr><td colspan="2" valign="top"><strong><a href="rzaiedirective-dict.htm#rzaiedirective-dict__Default">Default</a></strong>: CacheNegotiatedDocs off </td>
</tr>
<tr><td colspan="2" valign="top"><strong><a href="rzaiedirective-dict.htm#rzaiedirective-dict__Context">Context</a></strong>: <span id="cachenegotiateddocs__cachenegotiateddocs_context"><a name="cachenegotiateddocs__cachenegotiateddocs_context"><!-- --></a>server
config, virtual host</span></td>
</tr>
<tr><td colspan="2" valign="top"><strong><a href="rzaiedirective-dict.htm#rzaiedirective-dict__Override">Override</a></strong>: none </td>
</tr>
<tr><td colspan="2" valign="top"><strong><a href="rzaiedirective-dict.htm#rzaiedirective-dict__Origin">Origin</a></strong>: <span id="cachenegotiateddocs__cachenegotiateddocs_origin"><a name="cachenegotiateddocs__cachenegotiateddocs_origin"><!-- --></a>Apache </span></td>
</tr>
<tr><td colspan="2" valign="top"><strong><a href="rzaiedirective-dict.htm#rzaiedirective-dict__Example">Example</a></strong>: CacheNegotiatedDocs on </td>
</tr>
</tbody>
</table>
</div>
<p>The CacheNegotiatedDocs directive allows content-negotiated documents requested
using HTTP/1.0 to be cached by proxy servers. </p>
<dl class="block"><dt class="dlterm"><strong>Parameter</strong>: <em>on | off </em></dt>
<dd><ul><li>Setting this directive to <em>on</em> could mean that clients behind proxies
may retrieve versions of the documents that are not the best match for their
abilities. The purpose of this directive is to make cache more efficient.
This directive only applies to requests which come from HTTP/1.0 browsers.
HTTP/1.1 provides much better control over the caching of negotiated documents,
and this directive has no effect in responses to HTTP/1.1 requests. </li>
</ul>
</dd>
</dl>
</div>
</div>
<div class="hr" id="forcelanguagepriority"><a name="forcelanguagepriority"><!-- --></a><h2 class="topictitle2">ForceLanguagePriority</h2>
<div>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" frame="void" border="0" rules="none"><tbody><tr><td colspan="2" valign="top"><strong><a href="rzaiedirective-dict.htm#rzaiedirective-dict__Module">Module</a></strong>: mod_negotiation </td>
</tr>
<tr><td colspan="2" valign="top"><strong><a href="rzaiedirective-dict.htm#rzaiedirective-dict__Syntax">Syntax</a></strong>: ForceLanguagePriority <em>None | Prefer |
Fallback [Prefer | Fallback]</em> </td>
</tr>
<tr><td colspan="2" valign="top"><strong><a href="rzaiedirective-dict.htm#rzaiedirective-dict__Default">Default</a></strong>: ForceLanguagePriority None</td>
</tr>
<tr><td colspan="2" valign="top"><strong><a href="rzaiedirective-dict.htm#rzaiedirective-dict__Context">Context</a></strong>: <span id="forcelanguagepriority__forcelanguagepriority_context"><a name="forcelanguagepriority__forcelanguagepriority_context"><!-- --></a>server
config, virtual host, directory, .htaccess </span></td>
</tr>
<tr><td colspan="2" valign="top"><strong><a href="rzaiedirective-dict.htm#rzaiedirective-dict__Override">Override</a></strong>: FileInfo </td>
</tr>
<tr><td colspan="2" valign="top"><strong><a href="rzaiedirective-dict.htm#rzaiedirective-dict__Origin">Origin</a></strong>: <span id="forcelanguagepriority__forcelanguagepriority_origin"><a name="forcelanguagepriority__forcelanguagepriority_origin"><!-- --></a>Apache</span></td>
</tr>
<tr><td colspan="2" valign="top"><strong><a href="rzaiedirective-dict.htm#rzaiedirective-dict__Example">Example</a></strong>: See below.</td>
</tr>
</tbody>
</table>
</div>
<p>The ForceLanguagePriority directive uses the given LanguagePriority to
satisfy negotiation where the server could otherwise not return a single matching
document.</p>
<dl class="block"><dt class="dlterm"><strong>Parameter</strong>: <em>None | Prefer | Fallback </em></dt>
<dd><ul><li>The <em>Prefer</em> parameter uses LanguagePriority to serve one valid result,
rather than returning an HTTP result 300 (MULTIPLE CHOICES) when there are
several equally valid choices. If the directives below were given, and the
user's Accept-Language header assigned <em>en</em> and <em>de</em> each as quality
.500 (equally acceptable) then the first matching variant (<em>en</em>) will
be served. <pre>LanguagePriority en Fr de
ForceLanguagePriority Prefer</pre>
</li>
<li>The <em>Fallback</em> parameter uses LanguagePriority to serve a valid result,
rather than returning an HTTP result 406 (NOT ACCEPTABLE). If the directives
below were given, and the user's Accept-Language only permitted an <em>en</em> language
response, but such a variant isn't found, then the first variant from the
LanguagePriority list is served. <pre>LanguagePriority en Fr de
ForceLanguagePriority Fallback</pre>
</li>
</ul>
</dd>
</dl>
<p>Both options, <em>Prefer</em> and <em>Fallback</em>, may be specified, so either
the first matching variant from LanguagePriority will be served if more that
one variant is acceptable, or the first available document will be served
if none of the variants match the client's acceptable list of languages. </p>
<div class="note"><span class="notetitle">Note:</span> When specifying both <em>Prefer</em> and <em>Fallback</em> options, the
behavior is the same regardless of the order in which they are specified.</div>
<p>See <a href="rzaiemod_mime.htm#defaultlanguage">DefaultLanguage</a>, <a href="rzaiemod_mime.htm#addlanguage">AddLanguage</a> and <a href="#languagepriority">LanguagePriority</a>for
more information.</p>
</div>
</div>
<div class="hr" id="languagepriority"><a name="languagepriority"><!-- --></a><h2 class="topictitle2">LanguagePriority</h2>
<div>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" frame="void" border="0" rules="none"><tbody><tr><td colspan="2" valign="top"><strong><a href="rzaiedirective-dict.htm#rzaiedirective-dict__Module">Module</a></strong>: mod_negotiation</td>
</tr>
<tr><td colspan="2" valign="top"><strong><a href="rzaiedirective-dict.htm#rzaiedirective-dict__Syntax">Syntax</a></strong>: LanguagePriority <em>MIME-lang [MIME-lang...]</em> </td>
</tr>
<tr><td colspan="2" valign="top"><strong><a href="rzaiedirective-dict.htm#rzaiedirective-dict__Default">Default</a></strong>: none </td>
</tr>
<tr><td colspan="2" valign="top"><strong><a href="rzaiedirective-dict.htm#rzaiedirective-dict__Context">Context</a></strong>: <span id="languagepriority__languagepriority_context"><a name="languagepriority__languagepriority_context"><!-- --></a>server
config, virtual host, directory, .htaccess</span></td>
</tr>
<tr><td colspan="2" valign="top"><strong><a href="rzaiedirective-dict.htm#rzaiedirective-dict__Override">Override</a></strong>: FileInfo </td>
</tr>
<tr><td colspan="2" valign="top"><strong><a href="rzaiedirective-dict.htm#rzaiedirective-dict__Origin">Origin</a></strong>: <span id="languagepriority__languagepriority_origin"><a name="languagepriority__languagepriority_origin"><!-- --></a>Apache </span></td>
</tr>
<tr><td colspan="2" valign="top"><strong><a href="rzaiedirective-dict.htm#rzaiedirective-dict__Example">Example</a></strong>: LanguagePriority en Fr de </td>
</tr>
</tbody>
</table>
</div>
<p>The LanguagePriority directive sets the precedence of language variants
for the case where the client does not express a preference when handling
a MultiViews request. The list of MIME-lang are in order of decreasing preference. </p>
<dl class="block"><dt class="dlterm"><strong>Parameter</strong>: <em>MIME-lang </em></dt>
<dd><ul><li>The <em>MIME-lang</em> parameter is any Internet standard language tag or
MIME language designation. </li>
</ul>
</dd>
</dl>
<p>This directive may be configured multiple times in a container. The directives
are processed from the first to the last occurrence. </p>
<div class="note"><span class="notetitle">Note:</span> This directive only has an effect if a best language cannot be determined
by any other means. If the client expresses a language preference, this directive
has no effect on the file selected during content negotiation. </div>
</div>
</div>
</body>
</html>