<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body><preamble xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:"><p xmlns="http://www.w3.org/1999/xhtml"><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="4" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[4]</anchor-end> <dfn>RFC 2296</dfn> は手続き上は現行仕様ですが、誰も使っていない事実上の<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">廃止</anchor>状態にあります。</p><p xmlns="http://www.w3.org/1999/xhtml"><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="3" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[3]</anchor-end> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">RVSA/1.0</anchor> も参照。</p></preamble><p><strong>HTTP Remote Variant Selection Algorithm -- RVSA/1.0 <ins>HTTP 遠隔変種選択算法 —— RVSA/1.0</ins></strong><ul><li>Network Working Group                                        </li><li>Request for Comments: 2296                                          </li><li>Category: Experimental </li><li>K. Holtman</li><li>TUE</li><li>A. Mutz</li><li>Hewlett-Packard</li><li>March 1998</li></ul></p><section><h1>Status of this Memo</h1><blockquote><p>This memo defines an Experimental Protocol for the Internet
community.  It does not specify an Internet standard of any kind.
Discussion and suggestions for improvement are requested.
Distribution of this memo is unlimited.</p></blockquote></section><section><h1>Copyright Notice</h1><blockquote><p>Copyright (C) The Internet Society (1998).  All Rights Reserved.</p></blockquote></section><section><h1>ABSTRACT</h1><blockquote><p>HTTP allows web site authors to put multiple versions of the same
information under a single URL.  Transparent content negotiation is a
mechanism for automatically selecting the best version when the URL
is accessed.  A remote variant selection algorithm can be used to
speed up the transparent negotiation process. This document defines
the remote variant selection algorithm with the version number 1.0.</p></blockquote><p>HTTP は、ウェブ・サイトの著者が同じ情報の複数の版を一つの URL
の元に置くことを認めています。透過内容折衝はその URL 
に接続したときに最善の版を自動的に選択するための機構です。
遠隔変種選択算法は透過折衝過程を高速化するために使うことができます。
この文書は版番号 1.0 の遠隔変種選択算法を定義します。</p></section><section><h1>TABLE OF CONTENTS</h1><ol><li>1  Introduction...............................................2</li><li>2  Terminology and notation...................................2</li><li>3  The remote variant selection algorithm.....................2<ol><li>3.1 Input....................................................2</li><li>3.2 Output...................................................3</li><li>3.3 Computing overall quality values.........................3</li><li>3.4 Definite and speculative quality values..................5</li><li>3.5 Determining the result...................................6</li></ol></li><li>4  Use of the algorithm.......................................7<ol><li>4.1 Using quality factors to rank preferences................7</li><li>4.2 Construction of short requests...........................8<ol><li>4.2.1 Collapsing Accept- header elements.....................8</li><li>4.2.2 Omitting Accept- headers...............................9</li><li>4.2.3 Dynamically lengthening requests.......................9</li></ol></li><li>4.3 Differences between the local and the remote algorithm..10<ol><li>4.3.1 Avoiding major differences............................11</li><li>4.3.2 Working around minor differences......................11</li></ol></li></ol></li><li>5  Security and privacy considerations.......................11</li><li>6  Acknowledgments...........................................12</li><li>7  References................................................12</li><li>8  Authors' Addresses........................................12</li><li>9  Full Copyright Statement..................................13</li></ol></section><section><h1>1  Introduction</h1><blockquote><p>HTTP allows web site authors to put multiple versions (variants) of
the same information under a single URL.  Transparent content
negotiation [2] is a mechanism for automatically selecting the best
variant when the URL is accessed.  A remote variant selection
algorithm can be used by a HTTP server to choose a best variant on
behalf of a negotiating user agent.  The use of a remote algorithm
can speed up the transparent negotiation process by eliminating a
request-response round trip.</p></blockquote><p>HTTP は、著者に同じ情報の複数の版 (変種) を単一の URL
のもとに置くことを認めています。<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">透過内容折衝</anchor>はその URL
に接続した時に最善の変種を自動的に選択するための機構です。
遠隔変種選択算法は HTTP サーバーが折衝利用者エージェントに代わって最善の変種を選ぶために使用することができます。
遠隔算法を使うことによって要求‐応答の往復を省き、透過折衝過程を高速化できます。</p><blockquote><p>This document defines the remote variant selection algorithm with the
version number 1.0.  The algorithm computes whether the Accept-
headers in the request contain sufficient information to allow a
choice, and if so, which variant must be chosen.</p></blockquote><p>この文書は版番号 1.0 の遠隔変種選択算法を定義します。
この算法は要求の <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Accept‐かしら</anchor>が選ぶために十分な情報を含んでいるか、
含んでいるならどの変種が選ばれなければならないかを計算します。</p></section><section><h1>2  Terminology and notation</h1><blockquote><p>This specification uses the terminology and notation of the HTTP
transparent content negotiation specification [2].</p></blockquote><p>この仕様書は、 HTTP 透過内容折衝仕様書 (<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">RFC2295</anchor>)
の用語と記法を使います。</p></section><section><h1>3  The remote variant selection algorithm</h1><blockquote><p>This section defines the remote variant selection algorithm with the
version number 1.0.  To implement this definition, a server MAY run
any algorithm which gives equal results.</p></blockquote><p>この節では、版番号 1.0 の遠隔変種選択算法を定義します。
サーバーは、この定義を実装するために、同等の結果を与える任意の算法を走らせて<strong>構いません</strong>。</p><blockquote><p>Note: According to [2], servers are always free to return a list
response instead of running a remote algorithm.  Therefore,
whenever a server may run a remote algorithm, it may also run a
partial implementation of the algorithm, provided that the partial
implementation always returns List_response when it cannot compute the real result.</p></blockquote><p>注意 : RFC 2295 によれば、サーバーは常に自由に遠隔算法を走らせる代わりに<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">目録応答</anchor>を返せます。
従って、サーバーが遠隔算法を走らせてもよかろうがよかるまいが、
真の結果が計算できない時に <code class="conneg">List_response</code> 
を常に返すこの算法の部分実装を走らせても構いません。</p><section><h1>3.1 Input</h1><blockquote><p>The algorithm is always run for a particular request on a
particular transparently negotiable resource.  It takes the
following information as input.</p></blockquote><p>この算法は常に特定の<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">透過折衝可能資源</anchor>についての特定の<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">要求</anchor>に関して走らせます。
この算法は次の情報を入力として取ります。</p><blockquote><ul><li>1. The variant list of the resource, as present in the Alternates
header of the resource.</li><li>2. (Partial) Information about capabilities and preferences of the
user agent for this particular request, as given in the Accept-
headers of the request.</li></ul></blockquote><ul><li>応答の <code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Alternates</anchor></code> 頭として示す資源の<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">変種目録</anchor></li><li>要求の <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Accept‐頭群</anchor>で与えられた、この特定の要求についての<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">利用者エージェント</anchor>の能力と好みについての (部分的) 情報</li></ul><blockquote><p>If a fallback variant description</p></blockquote><p>Fallback <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">変種記述</anchor></p><blockquote><ul><li>{&quot;fallback.html&quot;}</li></ul></blockquote><blockquote><p>is present in the Alternates header, the algorithm MUST interpret it
as the variant description</p></blockquote><p>が <code class="HTTP">Alternates</code> 頭に示されている時は、この算法では変種記述</p><blockquote><ul><li>{&quot;fallback.html&quot; 0.000001}</li></ul></blockquote><p>として解釈しなければ<strong>なりません</strong>。</p><blockquote><p>The extremely low source quality value ensures that the fallback
variant only gets chosen if all other options are exhausted.</p></blockquote><p>極めて低い<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">原典品質</anchor>値とすることによって、他のすべての選択肢を使い果たしたときだけ
fallback 変種が選ばれるようにします。</p></section><section><h1>3.2 Output</h1><blockquote><p>As its output, the remote variant selection algorithm and will yield
the appropriate action to be performed.  There are two possibilities:</p></blockquote><p>遠隔変種選択算法は出力として取るべき適切な動作を与えます。
これは2つの可能性があります。</p><blockquote><dl><dt>Choice_response</dt><dd>
The Accept- headers contain sufficient information to make a
choice on behalf of the user agent possible, and the best
variant MAY be returned in a choice response.</dd><dt>List_response</dt><dd>
The Accept- headers do not contain sufficient information to
make a choice on behalf of the user agent possible.  A list
response MUST be returned, allowing the user agent to make the choice itself.</dd></dl></blockquote><dl><dt><code class="HTTP">Chouice_response</code></dt><dd>Accept‐ 頭群は利用者エージェントの代わりに選ぶのに十分な情報を含んでおり、
最善の変種を<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">選択応答</anchor>で返しても<strong>構いません</strong>。</dd><dt><code class="HTTP">List_response</code></dt><dd>Accept‐ 頭群は利用者エージェントの代わりに選ぶのに十分な情報を含んでいません。
利用者エージェントが自身で選ぶことができるように目録応答を返さなければ<strong>なりません</strong>。</dd></dl></section><section><h1>3.3 Computing overall quality values</h1><blockquote><p>As a first step in the remote variant selection algorithm, the
overall qualities of the individual variants in the list are computed.</p></blockquote><p>遠隔変種選択算法の最初の手順として、目録中の個々の変種の<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">全体品質</anchor>を計算します。</p><blockquote><p>The overall quality Q of a variant is the value</p></blockquote><p>変種の全体品質 <var>Q</var> は、値</p><blockquote><ul><li>Q = round5( qs * qt * qc * ql * qf )</li></ul></blockquote><blockquote><p>where round5 is a function which rounds a floating point value to 5
decimal places after the point, and where the factors qs, qt, qc, ql,
and qf are determined as follows.</p></blockquote><p>で、ここで <code>round5</code> は浮動小数点値を小数点以下5桁までに丸める関数で、
因子 <var>qs</var>, <var>qt</var>, <var>qc</var>, <var>ql</var>, <var>qf</var>
は次のように決定します。</p><blockquote><p>qs Is the source quality factor in the variant description.</p></blockquote><dl><dt><var>qs</var></dt><dd><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">変種記述</anchor>中の<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">原典品質</anchor>因子。</dd></dl><blockquote><p>qt The media type quality factor is 1 if there is no type
attribute in the variant description, or if there is no Accept
header in the request.  Otherwise, it is the quality assigned
by the Accept header to the media type in the type attribute.</p></blockquote><dl><dt><var>qt</var></dt><dd>変種記述に型属性がないか、要求中に <code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Accept</anchor></code>
頭がなければ<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">媒体型</anchor>品質因子は <code>1</code>。
そうでなければ、型品質因子は型属性中の媒体型に <code class="HTTP">Accept</code>
頭で割当てられた品質。</dd></dl><blockquote><p>Note: If a type is matched by none of the elements of an
Accept header, the Accept header assigns the quality factor 0 to that type.</p></blockquote><p>注意 : 型が <code class="HTTP">Accept</code> 頭の要素のどれにも一致しなければ、
<code class="HTTP">Accept</code> 頭は品質因子 <code>0</code>
をその型に割当てています。</p><blockquote><p>qc The charset quality factor is 1 if there is no charset
attribute in the variant description, or if there is no
Accept-Charset header in the request.  Otherwise, the charset
quality factor is the quality assigned by the Accept-Charset
header to the charset in the charset attribute.</p></blockquote><dl><dt><var>qc</var></dt><dd>変種記述に charset 属性がないか、要求中に <code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Accept-Charset</anchor></code>
頭がなければ <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">charset</anchor> 品質因子は <code>1</code>。
そうでなければ、 charset 品質因子は charset 属性中の媒体型に <code class="HTTP">Accept-Charset</code>
頭で割当てられた品質。</dd></dl><blockquote><p>ql The language quality factor is 1 if there is no language
attribute in the variant description, or if there is no
Accept-Language header in the request.  Otherwise, the language
quality factor is the highest quality factor assigned by the
Accept-Language header to any one of the languages listed in
the language attribute.</p></blockquote><dl><dt><var>ql</var></dt><dd>変種記述に言語属性がないか、要求中に <code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Accept-Language</anchor></code>
頭がなければ<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">言語</anchor>品質因子は <code>1</code>。
そうでなければ、言語品質因子は言語属性中に列挙された言語に <code class="HTTP">Accept-Language</code>
頭で割当てられた最高の品質因子。</dd></dl><blockquote><p>qf The features quality factor is 1 if there is no features
attribute in the variant description, or if there is no
Accept-Features header in the request.  Otherwise, it is the
quality degradation factor for the features attribute, see section 6.4 of [2].</p></blockquote><dl><dt><var>qs</var></dt><dd>変種記述に特徴属性がないか、要求中に <code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Accept-Features</anchor></code>
頭がなければ<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">特徴</anchor>品質因子は <code>1</code>。
そうでなければ、特徴品質因子は特徴属性の<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">品質減衰</anchor>因子。
RFC 2295 の6.4節参照。</dd></dl><blockquote><p>As an example, if a variant list contains the variant description</p></blockquote><p>例として、変種目録が変種記述</p><blockquote><ul><li>{&quot;paper.html.en&quot; 0.7 {type text/html} {language fr}}</li></ul></blockquote><blockquote><p>and if the request contains the Accept- headers</p></blockquote><p>を含むとして、要求が Accept‐ 頭群</p><blockquote><pre>     Accept: text/html:q=1.0, */*:q=0.8
     Accept-Language: en;q=1.0, fr;q=0.5</pre><p>the remote variant selection algorithm will compute an overall
quality for the variant as follows:</p></blockquote><p>を含んでいれば、遠隔変種選択算法はこの変種の全体品質を次のように計算します。</p><blockquote><pre>     {&quot;paper.html.fr&quot; 0.7 {type text/html} {language fr}}
                       |           |                 |
                       |           |                 |
                       V           V                 V
             round5 ( 0.7   *     1.0        *      0.5 ) = 0.35000</pre></blockquote><blockquote><p>With the above Accept- headers, the complete variant list</p></blockquote><p>前述の Accept‐ 頭群で、完全な変種目録</p><blockquote><pre>     {&quot;paper.html.en&quot; 0.9 {type text/html} {language en}},
     {&quot;paper.html.fr&quot; 0.7 {type text/html} {language fr}},
     {&quot;paper.ps.en&quot;   1.0 {type application/postscript} {language en}}</pre><p>would yield the following computations:</p></blockquote><p>は次の計算になります。</p><blockquote><pre>            round5 ( qs  * qt  * qc  * ql  * qf  ) =   Q
                     ---   ---   ---   ---   ---     -------
      paper.html.en: 0.9 * 1.0 * 1.0 * 1.0 * 1.0   = 0.90000
      paper.html.fr: 0.7 * 1.0 * 1.0 * 0.5 * 1.0   = 0.35000
      paper.ps.en:   1.0 * 0.8 * 1.0 * 1.0 * 1.0   = 0.80000</pre></blockquote></section><section><h1>3.4 Definite and speculative quality values</h1><blockquote><p>A computed overall quality value can be either definite or
speculative.  An overall quality value is definite if it was computed
without using any wildcard characters '*' in the Accept- headers, and
without the need to use the absence of a particular Accept- header.
An overall quality value is speculative otherwise.</p></blockquote><p>計算した全体品質値は決定的にも推測的にもなります。
全体品質値を Accept‐ 頭群の鬼札文字 <code class="HTTP">*</code>
を使わずに、また特定の Accept‐ 頭の不存在を使用する必要がなく計算できたなら決定的です。
それ以外の場合は全体品質値は推測的です。</p><blockquote><p>As an example, in the previous section, the quality values of
paper.html.en and paper.html.fr are definite, and the quality value
of paper.ps.en is speculative because the type application/postscript
was matched to the range */*.</p></blockquote><p>例として、前の状況で、 <code class="URI">paper.html.en</code>
と <code class="URI">paper.html.fr</code> の品質値は決定的で、
<code class="URI">paper.ps.en</code> の品質値は型 <code class="MIME"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">application/postscript</anchor></code>
が範囲 <code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">*/*</anchor></code> と一致したので推測的です。</p><blockquote><p>Definiteness can be defined more formally as follows.  An overall
quality value Q is definite if the same quality value Q can be
computed after the request message is changed in the following way:</p></blockquote><p>決定的性は次のようにしてより形式的に定義できます。
全体品質値 <var>Q</var> は要求メッセージを次の方法で変更してから同じ品質値
<var>Q</var> を計算できれば決定的です。</p><blockquote><ul><li>1. If an Accept, Accept-Charset, Accept-Language, or
Accept-Features header is missing from the request, add this
header with an empty field.</li><li>2. Delete any media ranges containing a wildcard character '*'
from the Accept header.  Delete any wildcard '*' from the
Accept-Charset, Accept-Language, and Accept-Features headers.</li></ul></blockquote><p><code class="HTTP">Accept</code> 頭, <code class="HTTP">Accept-Charset</code> 頭,
<code class="HTTP">Accept-Langauge</code> 頭または <code class="HTTP">Accept-Features</code> 頭が要求から欠けていたら、
これを空欄で追加する。<ul><li>鬼札文字 <code class="HTTP">*</code> を含んだ媒体範囲を <code class="HTTP">Accept</code>
頭から削除する。鬼札 <code class="HTTP">*</code> を
<code class="HTTP">Accept-Charset</code> 頭,
<code class="HTTP">Accept-Langauge</code> 頭および <code class="HTTP">Accept-Features</code> 頭から削除する。</li></ul></p><blockquote><p>As another example, the overall quality factor for the variant</p></blockquote><p>他の例として、変種</p><blockquote><ul><li>{&quot;blah.html&quot; 1 {language en-gb} {features blebber [x y]}}</li></ul></blockquote><blockquote><p>is 1 and definite with the Accept- headers</p></blockquote><p>の全体品質因子は Accept‐ 頭群</p><blockquote><ul><li>Accept-Language: en-gb, fr</li><li>Accept-Features: blebber, x, !y, *</li></ul></blockquote><blockquote><p>and</p></blockquote><p>および</p><blockquote><ul><li>Accept-Language: en, fr</li><li>Accept-Features: blebber, x, *</li></ul></blockquote><p>について <code>1</code> で、決定的です。</p><blockquote><p>The overall quality factor is still 1, but speculative, with the Accept- headers</p></blockquote><p>全体品質因子は Accept‐ 頭群</p><blockquote><ul><li>Accept-language: en-gb, fr</li><li>Accept-Features: blebber, !y, *</li></ul></blockquote><blockquote><p>and</p></blockquote><p>および</p><blockquote><ul><li>Accept-Language: fr, *</li><li>Accept-Features: blebber, x, !y, *</li></ul></blockquote><p>でも依然 <code>1</code> ですが、推測的です。</p></section><section><h1>3.5 Determining the result</h1><blockquote><p>The best variant, as determined by the remote variant selection
algorithm, is the one variant with the highest overall quality value,
or, if there are multiple variants which share the highest overall
quality, the first variant in the list with this value.</p></blockquote><p>遠隔変種選択算法で決定する最善の変種は、
最高の全体品質値の変種か、最高の全体品質の変種が複数ある場合には、その値を持つ目録中で最初の変種です。</p><blockquote><p>The end result of the remote variant selection algorithm is
Choice_response if all of the following conditions are met</p></blockquote><p>次のすべての状況に該当するなら、遠隔変種選択算法の最終結果は
<code>Choice_response</code> です。</p><blockquote><ul><li>a. the overall quality value of the best variant is greater than 0</li><li>b. the overall quality value of the best variant is a definite quality value</li><li>c. the variant resource is a neighbor of the negotiable resource.  This last condition exists to ensure that a
security-related restriction on the generation of choice
responses is met, see sections 10.2 and 14.2 of [2].</li></ul></blockquote><ul><li>最善の変種の全体品質値が <code>0] より大きい</code></li><li>最善の変種の全体品質値が決定的品質値である</li><li>その変種資源は折衝可能資源の隣接である。この最後の条件は選択応答の生成における安全に関する制限であって、
RFC 2295 の10.2節と14.2節を参照されたい。</li></ul><blockquote><p>In all other cases, the end result is List_response.</p></blockquote><p>他のすべての場合は、最終結果は <code>List_response</code> です。</p><blockquote><p>The requirement for definiteness above affects the interpretation of
Accept- headers in a dramatic way.  For example, it causes the remote
algorithm to interpret the header</p></blockquote><p>上述の決定的性の用件は劇的な形で Accept‐ 頭群の解釈に影響します。
例えば、遠隔算法が頭</p><blockquote><ul><li>Accept: image/gif;q=0.9, */*;q=1.0</li></ul></blockquote><blockquote><p>as</p></blockquote><p>を</p><blockquote><p>`I accept image/gif with a quality of 0.9, and assign quality
factors up to 1.0 to other media types.  If this information is
insufficient to make a choice on my behalf, do not make a choice
but send the list of variants'.</p></blockquote><p>「私は <code class="MIME"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">image/gif</anchor></code> を品質 <code class="HTTP">0.9</code>
で受け入れまして、他の媒体型には最大 <code class="HTTP">1.0</code>
の品質因子を割当てます。この情報が私の代わりに選ぶのに不十分であれば、
選ばないで変種の目録を送ってください。」</p><p>と解釈させることになります。</p><blockquote><p>Without the requirement, the interpretation would have been</p></blockquote><p>この要件がなければ、解釈は</p><blockquote><p>`I accept image/gif with a quality of 0.9, and all other media
types with a quality of 1.0'.</p></blockquote><p>「私は <code class="MIME">image/gif</code> を品質 <code class="HTTP">0.9</code>
で受け入れ、他のすべての媒体型を品質 <code class="HTTP">1.0</code> で受け入れます。」</p><p>となっていたでしょう。</p></section></section><section><h1>4  Use of the algorithm</h1><blockquote><p>This section discusses how user agents can use the remote algorithm
in an optimal way.  This section is not normative, it is included for
informational purposes only.</p></blockquote><p>この章では、利用者エージェントがどうやって最適な条件で遠隔算法を利用するかを取り上げます。
この章は規定ではなく、参考目的でのみ含めています。</p><section><h1>4.1 Using quality factors to rank preferences</h1><blockquote><p>Using quality factors, a user agent can not only rank the elements
within a particular Accept- header, it can also express precedence
relations between the different Accept- headers.  Consider for
example the following variant list:</p></blockquote><p>利用者エージェントは、品質因子を使って、
特定 Accept‐頭内の要素に順位付けるだけでなく異なる Accept‐
頭群間の優先度の関係をも表現できます。
次の変種目録の例を考えましょう。</p><blockquote><pre>     {&quot;paper.english&quot; 1.0 {language en} {charset ISO-8859-1}},
     {&quot;paper.greek&quot;   1.0 {language el} {charset ISO-8859-7}}</pre><p>and suppose that the user prefers &quot;el&quot; over &quot;en&quot;, while the user
agent can render &quot;ISO-8859-1&quot; with a higher quality than &quot;ISO-8859-7&quot;.  If the Accept- headers are</p></blockquote><p>そして、利用者は <code class="lang"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">en</anchor></code> よりも <code class="lang"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">el</anchor></code>
を好み、利用者エージェントは <code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ISO-8859-7</anchor></code>
よりも <code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ISO-8859-1</anchor></code> の方が高品質でレンダリングできるとします。
Accept‐頭群が</p><blockquote><ul><li>Accept-Language: gr, en;q=0.8</li><li>Accept-Charset: ISO-8859-1, ISO-8859-7;q=0.6, *</li></ul></blockquote><blockquote><p>then the remote variant selection algorithm would choose the English
variant, because this variant has the least overall quality
degradation.  But if the Accept- headers are</p></blockquote><p>であったとすると、遠隔変種選択算法は品質減退が最も少ない英語の変種を選ぶことになります。
しかし、 Accept‐頭群が</p><blockquote><ul><li>Accept-Language: gr, en;q=0.8</li><li>Accept-Charset: ISO-8859-1, ISO-8859-7;q=0.95, *</li></ul></blockquote><blockquote><p>then the algorithm would choose the Greek variant.  In general, the
Accept- header with the biggest spread between its quality factors
gets the highest precedence.  If a user agent allows the user to set
the quality factors for some headers, while other factors are hard-coded, it should use a low spread on the hard-coded factors and a
high spread on the user-supplied factors, so that the user settings
take precedence over the built-in settings.</p></blockquote><p>であれば、算法はギリシャ語変種を選ぶでしょう。
通常、その品質因子間で最大に配置した Accept‐ 頭群が最高の優先度を得ます。
利用者エージェントがある頭の品質因子を利用者に設定することを認めていながら他の因子は
hard‐code しているなら、 hard‐code 因子は低い方に配置し、
利用者供給様式の方は高く配置して、利用者の設定が組込みの設定よりも優先されるようにするべきです。</p></section><section><h1>4.2 Construction of short requests</h1><blockquote><p>In a request on a transparently negotiated resource, a user agent
need not send a very long Accept- header, which lists all of its
capabilities, to get optimal results.  For example, instead of sending</p></blockquote><p>透過折衝資源についての要求では、
利用者エージェントは最適な結果を得るために、
その能力をすべて列挙した非常に長い Accept‐
頭群を送信する必要はありません。
例えば、利用者エージェントは</p><blockquote><pre>     Accept: image/gif;q=0.9, image/jpeg;q=0.8, image/png;q=1.0,
             image/tiff;q=0.5, image/ief;q=0.5, image/x-xbitmap;q=0.8,
             application/plugin1;q=1.0, application/plugin2;q=0.9</pre><p>the user agent can send</p></blockquote><p>を送る代わりに、</p><blockquote><ul><li>Accept: image/gif;q=0.9, */*;q=1.0</li></ul></blockquote><p>を送ることができます。</p><blockquote><p>It can send this short header without running the risk of getting a
choice response with, say, an inferior image/tiff variant.  For
example, with the variant list</p></blockquote><p>利用者エージェントは、その、優先度の低い <code class="MIME"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">image/tiff</anchor></code>
変種の<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">選択応答</anchor>を得てしまう危険を冒さずにこの短い頭を送ることができます。
例えば、変種目録</p><blockquote><ul><li>{&quot;x.gif&quot; 1.0 {type image/gif}}, {&quot;x.tiff&quot; 1.0 {type image/tiff}},</li></ul></blockquote><blockquote><p>the remote algorithm will compute a definite overall quality of 0.9
for x.gif and a speculative overall quality value of 1.0 for x.tiff.
As the best variant has a speculative quality value, the algorithm
will not choose x.tiff, but return a list response, after which the
selection algorithm of the user agent will correctly choose x.gif.
The end result is the same as if the long Accept- header above had been sent.</p></blockquote><p>では、遠隔算法は <code class="URI">x.gif</code> には決定的全体品質 <code>0.9</code>
を計算し、 <code class="URI">x.tiff</code> には推測的品質値 <code>1.0</code>
を計算しますので、算法は <code class="URI">x.tiff</code> を選ばずに目録応答を返し、
その後利用者エージェントの選択算法は正しく <code class="URI">x.gif</code>
を選ぶことになります。
最終結果は上述の長い Accept‐ 頭を送った場合と同じです。</p><blockquote><p>Thus, user agents can vary the length of the Accept- headers to get
an optimal tradeoff between the speed with which the first request is
transmitted, and the chance that the remote algorithm has enough
information to eliminate a second request.</p></blockquote><p>従って、利用者エージェントは最初の要求が転送される速度と遠隔算法が二番目の要求を省くのに十分な情報を持つ機会との最適な取捨選択を得るために Accept‐ 頭群の長さを変化させることができます。</p></section><section><h1>4.2.1 Collapsing Accept- header elements</h1><blockquote><p>This section discusses how a long Accept- header which lists all
capabilities and preferences can be safely made shorter.  The remote
variant selection algorithm is designed in such a way that it is
always safe to shorten an Accept or Accept-Charset header by two
taking two header elements `A;q=f' and `B;q=g' and replacing them by
a single element `P;q=m' where P is a wildcard pattern that matches
both A and B, and m is the maximum of f and g.  Some examples are</p></blockquote><p>この節ではどうやってすべての能力と好みを列挙した Accept‐
頭群を安全に短くできるかを考えます。
遠隔変種選択算法は <samp class="HTTP"><var>A</var>;<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">q</anchor>=f</samp> と <samp class="HTTP"><var>B</var>;q=<var>g</var></samp>
の2つの頭要素を取って <var>A</var> と <var>B</var> の両者に一致する鬼札パターンである
<var>P</var> と <var>f</var> 及び <var>g</var> の最大値である <var>m</var>
を使った単一の要素 <samp class="HTTP"><var>P</var>;q=<var>m</var></samp>
で置き換えることで <code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Acept</anchor></code> 頭や
<code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Accept-Charset</anchor></code> を常に安全に短くできるように設計しています。
たとえば、</p><blockquote><pre>      text/html;q=1.0, text/plain;q=0.8       --&gt;    text/*;q=1.0
      image/*;q=0.8, application/*;q=0.7      --&gt;    */*;q=0.8
      iso-8859-5;q=1.0, unicode-1-1;q=0.8     --&gt;    *;q=1.0</pre></blockquote><blockquote><p>Note that every `;q=1.0' above is optional, and can be omitted:</p></blockquote><p>上記のすべての <code class="HTTP">;q=1.0</code> は省略可能なので、省略できることに注意。</p><blockquote><ul><li>iso-8859-7;q=0.6, *                     --&gt;    *</li></ul></blockquote><blockquote><p>For Accept-Language, it is safe to collapse all language ranges
with the same primary tag into a wildcard:</p></blockquote><p>同じ主札のすべての言語範囲は鬼札に安全にまとめられます。</p><p><code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Accept-Language</anchor></code> では、</p><blockquote><ul><li>en-us;q=0.9, en-gb;q=0.7, en;q=0.8, da  --&gt;    *;q=0.9, da</li></ul></blockquote><blockquote><p>It is also safe to collapse a language range into a wildcard, or to
replace it by a wildcard, if its primary tag appears only once:</p></blockquote><p>主札が一度だけ出現するのであれば、
この言語範囲を鬼札にまとめたり鬼札で置換したりすることも安全です。</p><blockquote><ul><li>*;q=0.9, da                             --&gt;    *</li></ul></blockquote><blockquote><p>Finally, in the Accept-Features header, every feature expression
can be collapsed into a wildcard, or replaced by a wildcard:</p></blockquote><p>最後に、 <code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Accept-Features</anchor></code> 頭では、
各特長式は鬼札にまとめたり、鬼札で置換することができます。</p><blockquote><ul><li>colordepth!=5, *                        --&gt;    *</li></ul></blockquote><section><h1>4.2.2 Omitting Accept- headers</h1><blockquote><p>According to the HTTP/1.1 specification [1], the complete absence of
an Accept header from the request is equivalent to the presence of
`Accept: */*'.  Thus, if the Accept header is collapsed to `Accept:</p></blockquote></section></section></section><section><h1>/*', a user agent may omit it entirely.  An Accept-Charset, Accept-Language, or Accept-Features header which only contains `*' may also</h1><p>be omitted.</p><p>HTTP/1.1 仕様書によれば、要求に完全に <code class="HTTP">Accept</code>
頭がないときには <code class="HTTP">Accept: */*</code>
があるのと同等です。従って、 <code class="HTTP">Accept</code>
頭を <code class="HTTP">Accept: */*</code> にまとめた場合には、
利用者エージェントはこれを完全に省いて構いません。
<code class="HTTP">Accept-Charset</code> 頭、<code class="HTTP">Accept-Language</code> 頭、
<code class="HTTP">Accept-Features</code> 頭で <code class="HTTP">*</code>
だけを含んだものも省略できます。</p><section><section><h1>4.2.3 Dynamically lengthening requests</h1><blockquote><p>In general, a user agent capable of transparent content negotiation
can send short requests by default.  Some short Accept- headers could
be included for the benefit of existing servers which use HTTP/1.0
style negotiation (see section 4.2 of [2]).  An example is</p></blockquote><p>通常、透過内容折衝能力のある利用者エージェントは既定で短い要求を送ることができます。
既存の HTTP/1.0 様式折衝を使うサーバーでの利益のために短い Accept‐
頭群を幾つか含めることもできます。例えば、</p><blockquote><pre>      GET /paper HTTP/1.1
      Host: x.org
      User-Agent: WuxtaWeb/2.4
      Negotiate: 1.0
      Accept-Language: en, *;q=0.9</pre></blockquote><blockquote><p>If the Accept- headers included in such a default request are not
suitable as input to the remote variant selection algorithm, the user
agent can disable the algorithm by sending `Negotiate: trans' instead
of `Negotiate: 1.0'.</p></blockquote><p>この既定の要求に含まれた Accept‐ 頭群が遠隔変種選択算法の入力として不適当であれば、
利用者エージェントは <code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Negotiate</anchor>: <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">trans</anchor></code>
を <code class="HTTP">Negotiate: 1.0</code> の代わりに送信することで算法を無効化出来ます。</p><blockquote><p>If the user agent discovers, though the receipt of a list or choice
response, that a particular origin server contains transparently
negotiated resources, it could dynamically lengthen future requests
to this server, for example to</p></blockquote><p>利用者エージェントが目録応答または選択応答の受領を通して特定の起源サーバーが透過折衝資源を含んでいると発見したら、
このサーバーへの以後の要求を動的に長くすることができます。例えば、</p><blockquote><pre>      GET /paper/chapter1 HTTP/1.1
      Host: x.org
      User-Agent: WuxtaWeb/2.4
      Negotiate: 1.0
      Accept: text/html, application/postscript;q=0.8, */*
      Accept-Language: en, fr;q=0.5, *;q=0.9
      Accept-Features: tables, *</pre></blockquote><blockquote><p>This will increase the chance that the remote variant selection
algorithm will have sufficient information to choose on behalf of the
user agent, thereby optimizing the negotiation process.  A good
strategy for dynamic extension would be to extend the headers with
those media types, languages, charsets, and feature tags mentioned in
the variant lists of past responses from the server.</p></blockquote><p>これで遠隔変種選択算法が利用者エージェントの変わりに選ぶのに十分な情報を得て折衝過程を最適化する機会が増えます。
サーバーの過去の応答の変種目録で触れられていた媒体型、言語、charset、特徴札で頭を伸ばすのは動的に伸ばすのの良い戦略です。</p></section></section><section><h1>4.3 Differences between the local and the remote algorithm</h1><blockquote><p>A user agent can only optimize content negotiation though the use of
a remote algorithm if its local algorithm will generally make the
same choice.  If a user agent receives a choice response containing a
variant X selected by the remote algorithm, while the local algorithm
would have selected Y, the user agent has two options:</p></blockquote><p>利用者エージェントは、その局所算法が通常同じ選択をする場合のみ遠隔算法の使用で内容折衝を最適化できます。
利用者エージェントが遠隔算法により選択された変種 <var>X</var>
を含んだ選択応答を受取って、局所算法は <var>Y</var>
を選択するであろう場合には、利用者エージェントには二つの選択肢があります。</p><blockquote><ul><li>1. Retrieve Y in a subsequent request. This is sub-optimal
because it takes time.</li><li>2. Display X anyway.  This is sub-optimal because it makes the
end result of the negotiation process dependent on factors that
can randomly change.  For the next request on the same resource,
and intermediate proxy cache could return a list response, which
would cause the local algorithm to choose and retrieve Y instead
of X.  Compared to a stable representation, a representation
which randomly switches between X and Y (say, the version with
and without frames) has a very low subjective quality for most users.</li></ul></blockquote><ul><li>後続要求で <var>Y</var> を取り出す。これは時間を取るので準最適化です。</li><li>とにかく <var>X</var> を表示する。
これは折衝過程の最終結果が無作為に変わり得る因子に依存しているので準最適化です。
同じ資源の次の要求では、媒介串キャッシュは
<var>X</var> の代わりに <var>Y</var> を選んで取り出す局所算法を動かす目録応答を返すことができます。
安定な表現に比較すると、 <var>X</var> と <var>Y</var> (まあ、フレーム版と非フレーム版) で無作為に切り替わる表現はほとんどの利用者にはとても低い主観的品質を持ちます。</li></ul><blockquote><p>As both alternatives above are unattractive, a user agent should try
to avoid the above situation altogether.  The sections below discuss
how this can be done.</p></blockquote><p>両選択肢が共に美しくなければ、利用者エージェントはこの状況を共に避けるように努力するべきです。
次の節ではこれをどうやってなるかを取り上げます。</p><section><h1>4.3.1 Avoiding major differences</h1><blockquote><p>If the user agent enables the remote algorithm in this specification,
it should generally use a local algorithm which closely resembles the
remote algorithm.  The algorithm should for example also use
multiplication to combine quality factors.  If the user agent
combines quality factors by addition, it would be more advantageous
to define a new remote variant selection algorithm, with a new major
version number, for use by this agent.</p></blockquote><p>利用者エージェントがこの仕様書の遠隔算法を有効にするなら、
通常は遠隔算法によく似た局所算法を使うべきです。
局所算法も例えば品質因子の結合に乗算を使うべきです。
利用者エージェントが品質因子を加算で結合するなら、
そのエージェントが使うための新しい大版の新しい遠隔変種選択算法を定義する方がより有利でしょう。</p></section><section><h1>4.3.2 Working around minor differences</h1><blockquote><p>Even if a local algorithm uses multiplication to combine quality
factors, it could use an extended quality formulae like</p></blockquote><p>局所算法が品質因子の結合に乗算を使っていたとしても、
利用者エージェントの制限による次元間の特別の相互依存を考慮に入れるために</p><blockquote><ul><li>Q = round5( qs * qt * qc * ql * qf ) * q_adjust</li></ul></blockquote><blockquote><p>in order to account for special interdependencies between dimensions,
which are due to limitations of the user agent.  For example, if the
user agent, for some reason, cannot handle the iso-8859-7 charset
when rendering text/plain documents, the q_adjust factor would be 0
when the text/plain - iso-8859-7 combination is present in the
variant description, and 1 otherwise.</p></blockquote><p>のように拡張した品質公式を使うこともできます。
例えば、利用者エージェントが何らかの理由で <code class="MIME"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">text/plain</anchor></code>
文書をレンダリングするときに <code class="charset">iso-8859-7</code>
charset を取扱えないとすると、 <var>q_adjust</var>
因子は <code class="MIME">text/plain</code>‐<code class="charset">iso-8859-7</code>
の組合せで変種記述に現れた時には <code>0</code>
で他の時には <code>1</code> とします。</p><blockquote><p>By selectively withholding information from the remote variant
selection algorithm, the user agent can ensure that the remote
algorithm will never make a choice if the local q_adjust is less than
1.  For example, to prevent the remote algorithm from ever returning
a text/plain - iso-8859-7 choice response, the user agent should take
care to never produce a request which exactly specifies the quality
factors of both text/plain and iso-8859-7.  The omission of either
factor from a request will cause the overall quality value of any
text/plain - iso-8859-7 variant to be speculative, and variants with
speculative quality values can never be returned in a choice response.</p></blockquote><p>利用者エージェントは、
遠隔変種選択算法に選択的に情報を与えないことによって、
遠隔算法が局所 <var>q_adjust</var> が <code>1</code> 未満の選択を決して行わないようにできます。
例えば、遠隔算法が <code class="MIME">text/plain</code>‐<code class="charset">iso-8859-7</code>
選択応答を返すことのないようにするために、
利用者エージェントは <code class="MIME">text/plain</code> と
<code class="charset">iso-8859-7</code> の両者の品質因子を正確に指定する要求を決して生成することのないように注意するべきです。
要求からどちらかの因子を省くことによって、
<code class="MIME">text/plain</code>‐<code class="charset">iso-8859-7</code> 変種の全体品質値は推測的となり、
推測的品質値の変種は決して選択応答で返されることはありません。</p><blockquote><p>In general, if the local q_adjust does not equal 1 for a particular
combination X - Y - Z, then a remote choice can be prevented by
always omitting at least one of the elements of the combination from
the Accept- headers, and adding a suitable wildcard pattern to match
the omitted element, if such a pattern is not already present.</p></blockquote><p>一般に、局部 <var>q_adjust</var> が特定の組合せ  <var>X</var>‐<var>Y</var>‐<var>Z</var>
で <code>1</code> に等しくなければ、組合せの要素の最低1つを
Accept‐ 頭群から省略し、省略した要素に一致する適当な鬼札パターンが既に存在しなければそれを追加することで、
遠隔選択を防ぐことができます。</p></section></section></section><section><h1>5  Security and privacy considerations</h1><blockquote><p>This specification introduces no security and privacy considerations
not already covered in [2].  See [2] for a discussion of privacy
risks connected to the sending of Accept- headers.</p></blockquote><p>この仕様書は既に RFC 2295 で既に覆われていない安全と個人情報に関する考察を求めません。
Accept‐ 頭群を送ることに関係する個人情報的危険についての議論は RFC 2295
を見て下さい。</p></section><section><h1>6  Acknowledgments</h1><blockquote><p>Work on HTTP content negotiation has been done since at least 1993.
The authors are unable to trace the origin of many of the ideas
incorporated in this document.  Many members of the HTTP working
group have contributed to the negotiation model in this
specification.  The authors wish to thank the individuals who have
commented on earlier versions of this document, including Brian
Behlendorf, Daniel DuBois, Ted Hardie, Larry Masinter, and Roy T. Fielding.</p></blockquote><p>HTTP 内容折衝の作業は少なくても1993年から行われています。
著者はこの文書に組み込まれた考えの多くの起源を追跡できません。
HTTP 作業部会の参加者の多くがこの仕様の折衝模型に貢献してくださいました。
著者は特に、 Brian
Behlendorf, Daniel DuBois, Ted Hardie, Larry Masinter, Roy T. Fielding
を含むこの文書の初期の版から意見してくださっている方々に感謝したいと思います。</p></section><section><h1>7  References</h1><pre>   [1] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., and
       T. Berners-Lee, &quot;Hypertext Transfer Protocol -- HTTP/1.1&quot;, RFC
       2068, January 1997.</pre><insert xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:"><p xmlns="http://www.w3.org/1999/xhtml">訳注 : <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">RFC2068</anchor> は後に改訂されて <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">RFC2616</anchor> になりました。</p></insert><pre>   [2] Holtman, K., and A. Mutz, &quot;Transparent Content Negotiation in
       HTTP&quot;, RFC 2295, March 1998.</pre></section><section><h1>8  Authors' Addresses</h1><pre>   Koen Holtman
   Technische Universiteit Eindhoven
   Postbus 513
   Kamer HG 6.57
   5600 MB Eindhoven (The Netherlands)</pre><pre>   EMail: koen@win.tue.nl</pre><pre>   Andrew H. Mutz
   Hewlett-Packard Company
   1501 Page Mill Road 3U-3
   Palo Alto CA 94304, USA</pre><pre>   Fax:   +1 415 857 4691
   EMail: mutz@hpl.hp.com</pre></section><section><h1>9  Full Copyright Statement</h1><pre>   Copyright (C) The Internet Society (1998).  All Rights Reserved.</pre><pre>   This document and translations of it may be copied and furnished to
   others, and derivative works that comment on or otherwise explain it
   or assist in its implementation may be prepared, copied, published
   and distributed, in whole or in part, without restriction of any
   kind, provided that the above copyright notice and this paragraph are
   included on all such copies and derivative works.  However, this
   document itself may not be modified in any way, such as by removing
   the copyright notice or references to the Internet Society or other
   Internet organizations, except as needed for the purpose of
   developing Internet standards in which case the procedures for
   copyrights defined in the Internet Standards process must be
   followed, or as required to translate it into languages other than
   English.</pre><pre>   The limited permissions granted above are perpetual and will not be
   revoked by the Internet Society or its successors or assigns.</pre><pre>   This document and the information contained herein is provided on an
   &quot;AS IS&quot; basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
   TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
   BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
   HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
   MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.</pre></section><section><h1>License</h1><p><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">RFCのライセンス</anchor>。</p></section><section><h1>メモ</h1></section></body></html>