<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body><p><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> <dfn><code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Vary:</anchor></code></dfn> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ヘッダー</anchor>は、<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">内容折衝</anchor>に用いた<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><p><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> この<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ヘッダー</anchor>は、同じ <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">URL</anchor> で出し分けされている複数の<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><section><h1>仕様書</h1><refs xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:"><ul xmlns="http://www.w3.org/1999/xhtml"><li><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2625" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[2625]</anchor-end> <strong><cite xml:lang="en">RFC 7231 - Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content</cite> (<time>2014-08-07 05:54:02 +09:00</time> 版) <anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://tools.ietf.org/html/rfc7231#section-7.1.4">https://tools.ietf.org/html/rfc7231#section-7.1.4</anchor-external></strong></li><li><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[2]</anchor-end> <cite xml:lang="en">RFC 7231 - Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content</cite> (<time>2014-08-07 05:54:02 +09:00</time> 版) <anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://tools.ietf.org/html/rfc7231#page-79">https://tools.ietf.org/html/rfc7231#page-79</anchor-external></li><li><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="9" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[9]</anchor-end> <cite xml:lang="en">RFC 7234 - Hypertext Transfer Protocol (HTTP/1.1): Caching</cite> (<time>2014-09-11 10:19:59 +09:00</time> 版) <anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://tools.ietf.org/html/rfc7234#section-4.1">https://tools.ietf.org/html/rfc7234#section-4.1</anchor-external></li><li><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="38" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[38]</anchor-end> <cite xml:lang="en">RFC 7240 - Prefer Header for HTTP</cite> (<time>2014-07-26 04:24:01 +09:00</time> 版) <anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://tools.ietf.org/html/rfc7240#section-2">https://tools.ietf.org/html/rfc7240#section-2</anchor-external></li><li><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="41" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[41]</anchor-end> <cite xml:lang="en">RFC 2295 - Transparent Content Negotiation in HTTP</cite> (<time>2014-08-31 19:36:42 +09:00</time> 版) <anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="http://tools.ietf.org/html/rfc2295#section-10.1">http://tools.ietf.org/html/rfc2295#section-10.1</anchor-external></li><li><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="45" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[45]</anchor-end> <cite xml:lang="en">RFC 2295 - Transparent Content Negotiation in HTTP</cite> (<time>2014-08-31 19:36:42 +09:00</time> 版) <anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="http://tools.ietf.org/html/rfc2295#section-10.2">http://tools.ietf.org/html/rfc2295#section-10.2</anchor-external></li><li><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="47" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[47]</anchor-end> <cite xml:lang="en">RFC 2295 - Transparent Content Negotiation in HTTP</cite> (<time>2014-08-31 19:36:42 +09:00</time> 版) <anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="http://tools.ietf.org/html/rfc2295#section-10.3">http://tools.ietf.org/html/rfc2295#section-10.3</anchor-external></li><li><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="46" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[46]</anchor-end> <cite xml:lang="en">RFC 2295 - Transparent Content Negotiation in HTTP</cite> (<time>2014-08-31 19:36:42 +09:00</time> 版) <anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="http://tools.ietf.org/html/rfc2295#section-10.6">http://tools.ietf.org/html/rfc2295#section-10.6</anchor-external></li><li><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="55" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[55]</anchor-end> <cite xml:lang="en">RFC 2295 - Transparent Content Negotiation in HTTP</cite> (<time>2014-08-31 19:36:42 +09:00</time> 版) <anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="http://tools.ietf.org/html/rfc2295#section-13">http://tools.ietf.org/html/rfc2295#section-13</anchor-external></li></ul></refs></section><section><h1>意味</h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2629" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[2629]</anchor-end> <code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Vary:</anchor></code> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ヘッダー</anchor>は、
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">要求メッセージ</anchor>の (<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">要求メソッド</anchor>、 <code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Host:</anchor></code>、
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">要求対象</anchor>以外の) どの部分が<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">起源鯖</anchor>における当該<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">応答</anchor>の選択と表現の処理に影響したかもしれないかを説明するものです
<src xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2625" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;2625</anchor-internal></src>。</p></section><section><h1>構文</h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2630" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[2630]</anchor-end> 値は、 <code><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">*</anchor></code> のみか、または1つ<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">以上</anchor>の<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ヘッダー名</anchor>の<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">リスト</anchor> (<code>#</code>) です。
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ヘッダー名</anchor>は<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">大文字・小文字不区別</anchor>です。 <src xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2625" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;2625</anchor-internal></src></p><figure class="railroad"><ol><li>|<ol><li><code><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">*</anchor></code></li><li>=<ol><li><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ヘッダー名</anchor></li><li>*<ol><li><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">OWS</anchor></li><li><code><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">,</anchor></code></li><li><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">OWS</anchor></li><li><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ヘッダー名</anchor></li></ol></li></ol></li></ol></li></ol></figure></section><section><h1>文脈</h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2638" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[2638]</anchor-end> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">起源鯖</anchor>は、<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">要求メソッド</anchor>と<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">要求対象</anchor>以外の<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">要求メッセージ</anchor>の状況を元に異なる<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">表現</anchor>を選択している場合には、異なりを示せない場合や敢えて<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">キャッシュ透過性</anchor>を失くすよう設定されている場合を除き、
<code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Vary:</anchor></code> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ヘッダー</anchor>を送信する<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:"><strong xmlns="http://www.w3.org/1999/xhtml">べきです</strong></anchor>。 <src xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2625" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;2625</anchor-internal></src></p><example 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="2639" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[2639]</anchor-end> 例えば <code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Authorization:</anchor></code> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ヘッダー</anchor>は定義上別の<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">利用者</anchor>に<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">応答</anchor>を再利用できないと決められているので敢えて
<code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Vary:</anchor></code> に示す必要はありません。 <src xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2625" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;2625</anchor-internal></src></p></example><comment-p xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2640" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[2640]</anchor-end> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">起源鯖</anchor>は、 <code xmlns="http://www.w3.org/1999/xhtml" class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Vary:</anchor></code> が<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">キャッシュ</anchor>に影響することによる性能の問題に比べると異なった<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">表現</anchor>の存在は重要ではないと考えるなら、
<code xmlns="http://www.w3.org/1999/xhtml" class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Cache-Control:</anchor></code> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ヘッダー</anchor>を使って制御できます。 <src><anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2625" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;2625</anchor-internal></src></comment-p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="42" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[42]</anchor-end> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">リスト応答</anchor>、<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">選択応答</anchor>、<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">臨時応答</anchor>は <code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Vary:</anchor></code> 
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ヘッダー</anchor>を含まなければ<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:"><strong xmlns="http://www.w3.org/1999/xhtml">なりません</strong></anchor>。
<code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Vary:</anchor> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">*</anchor></code> でも構いませんし、より詳細な指定でも構いません。
<src xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="41" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;41</anchor-internal>, <anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="45" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;45</anchor-internal>, <anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="47" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;47</anchor-internal>, <anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="46" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;46</anchor-internal></src>
より詳細な指定を行う場合は、次のようにします <src xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="46" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;46</anchor-internal></src>。<figure class="steps"><ol><li><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="49" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[49]</anchor-end> <code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">negotiate</anchor></code> を追加します。</li><li><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="50" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[50]</anchor-end> <code class="HTTP" xml:lang="en"><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>の<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">異体説明</anchor>のいずれかに次の<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">属性</anchor>が含まれていれば、対応する<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ヘッダー名</anchor>を追加します。<figure><table><tbody><tr><td><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">属性</anchor></td><td><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ヘッダー名</anchor></td></tr><tr><td><code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">type</anchor></code></td><td><code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">accept</anchor></code></td></tr><tr><td><code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">charset</anchor></code></td><td><code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">accept-charset</anchor></code></td></tr><tr><td><code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">language</anchor></code></td><td><code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">accept-language</anchor></code></td></tr><tr><td><code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">features</anchor></code></td><td><code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">accept-features</anchor></code></td></tr></tbody></table></figure></li><li><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="51" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[51]</anchor-end> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">起源鯖</anchor>が場合によっては独自の折衝方法を (例えば<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">透過内容折衝</anchor>に対応しない<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">利用者エージェント</anchor>向けに) 使っており、他の<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ヘッダー</anchor>も使うなら、それも追加する<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:"><strong xmlns="http://www.w3.org/1999/xhtml">べきです</strong></anchor>。</li><li><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="53" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[53]</anchor-end> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">内容符号化</anchor>の<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">内容折衝</anchor>も行っているなら、
<code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Accept-Encoding</anchor></code> を追加します。</li></ol></figure></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="39" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[39]</anchor-end> <code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Prefer:</anchor></code> の指定 (またはその欠如) によって<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">応答</anchor>の<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">キャッシュ</anchor>に影響を及ぼし得るなら、
<code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Vary:</anchor></code> に <code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Prefer</anchor></code> か <code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">*</anchor></code>
を指定しなければ<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:"><strong xmlns="http://www.w3.org/1999/xhtml">なりません</strong></anchor> <src xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="38" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;38</anchor-internal></src>。</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="8" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[8]</anchor-end> <code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">304</anchor></code> の項も参照してください。</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2645" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[2645]</anchor-end> <code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Vary:</anchor></code> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ヘッダー</anchor>は複数指定できません。</p><comment-p xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="443" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">HTTPヘッダー</anchor></comment-p></section><section><h1>ヘッダー名</h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2634" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[2634]</anchor-end> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ヘッダー名</anchor>は、<rubyb xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">選択に関わったヘッダー<rt xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">selecting header field</rt></rubyb>、
すなわち<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">表現</anchor>の選択に関わったかもしれない<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ヘッダー</anchor>を表します。 <src xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2625" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;2625</anchor-internal></src></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2644" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[2644]</anchor-end> この<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ヘッダー名</anchor>は、<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">要求</anchor>に明示されている<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ヘッダー</anchor>の名前でなくても構いません。
ある<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ヘッダー</anchor>が存在しないことが<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><example 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="2635" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[2635]</anchor-end> 例えば、<pre class="HTTP code">Vary: accept-encoding, accept-language</pre>... は、<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">起源鯖</anchor>が<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">応答</anchor>の<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">表現</anchor>を選ぶに当たり<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">要求</anchor>の
<code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Accept-Encoding:</anchor></code> と <code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Accept-Language:</anchor></code>
(あるいはその不存在) を考慮したかもしれないことを表しています <src xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2625" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;2625</anchor-internal></src>。</p></example><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2646" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[2646]</anchor-end> <code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Accept</anchor></code>, <code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Accept-Language</anchor></code>,
<code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Accept-Encoding</anchor></code> などがよく指定されています。
<code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Negotiate</anchor></code> が (意味もなく) 指定されることもよくあります。</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2647" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[2647]</anchor-end> <code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">User-Agent</anchor></code> や <code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Cookie</anchor></code>
が指定されることもありますが、明示されないこともよくあります。</p><comment-p xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2648" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[2648]</anchor-end> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">鯖</anchor>側で<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">逆串</anchor>たる<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">キャッシュ</anchor>の裏に<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">アプリケーション鯖</anchor>が存在する構成の時、
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">アプリケーション鯖</anchor>で <code xmlns="http://www.w3.org/1999/xhtml" class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Vary:</anchor> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">User-Agent</anchor></code> 
などと指定するとほとんど<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">キャッシュ</anchor>が効かなくなる可能性があります。</comment-p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="6" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[6]</anchor-end> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">RFC 7231</anchor> は<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ヘッダー</anchor>の仕様書に対し、 <code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Vary:</anchor></code>
に<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ヘッダー名</anchor>を指定するのが適当かどうか明記することを検討するよう求めています <src xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;2</anchor-internal></src>。</p><comment-p xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="7" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[7]</anchor-end> ただし <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">RFC 723x</anchor> は明記していません。</comment-p></section><section><h1><code>*</code></h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2631" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[2631]</anchor-end> <code><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">*</anchor></code> は<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">要求</anchor>の何かが<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">応答</anchor>の<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">表現</anchor>の選択に影響したかもしれないことを表します。影響した要素は<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">メッセージ</anchor>外の何か
(例えば<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">クライアント</anchor>の<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ネットワークアドレス</anchor>) かもしれません。 <src xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2625" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;2625</anchor-internal></src></p><comment-p xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2649" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[2649]</anchor-end> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">クライアント</anchor>の <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">IPアドレス</anchor>によって出力が変化するようなページでは、
<code xmlns="http://www.w3.org/1999/xhtml" class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Vary:</anchor> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">*</anchor></code> を使うことができます。しかし実際にはほとんど明示されません。</comment-p><comment-p xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2650" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[2650]</anchor-end> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">IPアドレス</anchor>によって <code xmlns="http://www.w3.org/1999/xhtml" class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">200</anchor></code> を返したり
<code xmlns="http://www.w3.org/1999/xhtml" class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">403</anchor></code> を返したりする場合にも<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">表現</anchor>の選択に影響したと言えるのでしょうか?</comment-p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2632" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[2632]</anchor-end> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">受信者</anchor>は、この<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">応答</anchor>を以後の<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">要求</anchor>に適切かどうかを、
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">要求</anchor>を<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">起源鯖</anchor>に<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">転送</anchor>することなく決定はできません。 <src xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2625" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;2625</anchor-internal></src></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2633" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[2633]</anchor-end> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">串</anchor>は、 <code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Vary:</anchor> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">*</anchor></code> を<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">生成</anchor>しては<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:"><strong xmlns="http://www.w3.org/1999/xhtml">なりません</strong></anchor>
<src xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2625" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;2625</anchor-internal></src>。</p></section><section><h1>処理モデル</h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2636" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[2636]</anchor-end> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">キャッシュ</anchor>の<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">受信者</anchor>は、<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">蓄積</anchor>された<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">応答</anchor>の <code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Vary:</anchor></code> 
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ヘッダー</anchor>で指定された<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ヘッダー</anchor>が元の<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">要求</anchor>と以後の<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">要求</anchor>とで<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">一致</anchor>しない限り、
その以後の<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">要求</anchor>を満足するために当該<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">応答</anchor>を使っては<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:"><strong xmlns="http://www.w3.org/1999/xhtml">なりません</strong></anchor> <src xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2625" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;2625</anchor-internal>, <anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="9" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;9</anchor-internal></src>。
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">蓄積</anchor>された<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">応答</anchor>と<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">一致</anchor>した場合、これを<rubyb xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">選択された応答<rt xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">selected response</rt></rubyb>といいます <src xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="9" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;9</anchor-internal></src>。</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="10" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[10]</anchor-end> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ヘッダー</anchor>の比較にあたっては、<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">空白</anchor>の加除を行ったり、
同名の<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ヘッダー</anchor>を結合したり (<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">HTTPヘッダー</anchor>参照。)、
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ヘッダー</anchor>の定義に則り同じ意味を持つ値を<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">正規化</anchor>したりすることにより同じ値となるなら、
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">一致</anchor>とします <src xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="9" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;9</anchor-internal></src>。</p><comment-p xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="29" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[29]</anchor-end> 値の正規化においては、値を列挙していて順序が重要でないときにこれを入れ替えたり、
大文字と小文字を区別しない場合にこれを書き換えたりすることができるとされています <src><anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="9" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;9</anchor-internal></src>
が、仕様上明確には定義されていません。各<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ヘッダー</anchor>の仕様書に従い<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">キャッシュ</anchor>の実装者が判断する必要があります。</comment-p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="30" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[30]</anchor-end> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ヘッダー</anchor>の比較にあたっては、 (<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">正規化</anchor>後に) 一方に当該<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ヘッダー</anchor>がないなら、
他方もその<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ヘッダー</anchor>がない場合のみ<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">一致</anchor>します <src xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="9" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;9</anchor-internal></src>。</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="34" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[34]</anchor-end> <code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Vary:</anchor> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">*</anchor></code> の場合は、常に<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">一致</anchor>しません <src xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="9" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;9</anchor-internal></src>。</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="35" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[35]</anchor-end> 選択された応答が複数ある場合で、 <code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Vary:</anchor></code>
で指定された<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ヘッダー</anchor>による選択方法が既知の場合は、
それを使って<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">応答</anchor>を選択して構いません。例えば <code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Accept:</anchor></code>
なら <code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">q</anchor></code> 値を使って選択できます。
そうでない場合は <code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Date:</anchor></code> の日付が最も新しいものを使わなければなりません。 <src xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="9" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;9</anchor-internal></src></p><comment-p xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="36" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[36]</anchor-end> 候補となる<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">応答</anchor>に <code xmlns="http://www.w3.org/1999/xhtml" class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Vary:</anchor></code> がないものが含まれることにも言及はあります
<src><anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="9" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;9</anchor-internal></src> が、その場合に選択方法をどう決定するのか、あるいは <code xmlns="http://www.w3.org/1999/xhtml" class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Vary:</anchor></code>
が異なる<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">応答</anchor>が複数ある時に選択方法をどう決定するのかは明らかではありません。</comment-p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="37" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[37]</anchor-end> 選択された応答がない場合、普通は<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">起源鯖</anchor>へと (場合によっては<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">条件付き要求</anchor>で)
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">転送</anchor>します <src xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="9" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;9</anchor-internal></src>。</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2637" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[2637]</anchor-end> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">利用者エージェント</anchor>の<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">受信者</anchor>は、 <code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Vary:</anchor></code>
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ヘッダー</anchor>に<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ヘッダー名</anchor>が指定されていることによりその<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">応答</anchor>が<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">内容折衝</anchor>の対象であると認識し、
指定されている<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ヘッダー</anchor>に更に値を加える事で別の<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">表現</anchor>が得られるかもしれないと判断できます
(<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">proactive negotiation</anchor>)。 <src xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2625" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;2625</anchor-internal></src></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2641" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[2641]</anchor-end> 実際のところ <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">proactive negotiation</anchor> は使われておらず、
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">利用者エージェント</anchor>は一般に <code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Vary:</anchor></code> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ヘッダー</anchor>を無視していると思われます。
理論上は<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">利用者エージェント</anchor>の<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">キャッシュ</anchor>でも区別が必要ですが、
実用上は同じ<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">利用者エージェント</anchor>で頻繁に <code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Accept:</anchor></code>
や <code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Accept-Language:</anchor></code> の値を変更することはありませんから、
問題とはならないはずです。</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2642" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[2642]</anchor-end> 実際には<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">鯖</anchor>が <code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Vary:</anchor></code> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ヘッダー</anchor>を指定することや正しい内容を記載することは保証されていませんから、
これを信頼するのは難しいと思われます。例えば多くの<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Webアプリケーション</anchor>が<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">鯖</anchor>側で
<code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">User-Agent:</anchor></code> による<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">応答</anchor>の出し分けを行っていますが、
<code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Vary:</anchor> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">User-Agent</anchor></code> を明示しないのが普通です。
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">共有キャッシュ</anchor>のような任意の<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">鯖</anchor>に接続する<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">串</anchor>では、
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">URL</anchor> と <code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Vary:</anchor></code> のみによる<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">キャッシュ</anchor>の管理は実用的ではなさそうです。
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">著者</anchor>側が構成を完全に管理可能な<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">逆串</anchor>型の<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">キャッシュ</anchor>であれば
<code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Vary:</anchor></code> による<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">キャッシュ</anchor>の管理は可能で、実際に大規模な
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Webアプリケーション</anchor>のキャッシュのために用いられています。</p><comment-p xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2643" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[2643]</anchor-end> ところで<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">キャッシュ</anchor>を行う<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">串</anchor>の中には <code xmlns="http://www.w3.org/1999/xhtml" class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Vary:</anchor></code>
に対応しておらず、<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">対象資源</anchor>の <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">URL</anchor> のみに基づくものもあります。</comment-p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="48" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[48]</anchor-end> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">キャッシュ</anchor>は <code class="HTTP" xml:lang="en"><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>を取り出して再利用する時は、
<code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Vary:</anchor></code> も取り出して同時に再利用して構いません。ただしきれいな
<code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Vary:</anchor></code> を取り出せるのは<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">異体</anchor>も「vary」しない場合、
つまり <code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Variant-Vary:</anchor></code> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ヘッダー</anchor>がない場合だけです。 <src xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="46" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;46</anchor-internal></src></p><comment-p xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="52" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[52]</anchor-end> ただし <code xmlns="http://www.w3.org/1999/xhtml" class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Variant-Vary:</anchor></code> の有無によって動作を変えなければならないという要件も特に無いようです。</comment-p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="54" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[54]</anchor-end> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">透過内容折衝に対応</anchor>する<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">キャッシュ</anchor>は、<code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Vary:</anchor></code>
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ヘッダー</anchor>で示された条件が一致しなかったとしても、<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">キャッシュ</anchor>された<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">新鮮</anchor>な<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">リスト応答</anchor>を返すことができます <src xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="55" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;55</anchor-internal></src>。</p><comment-p xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="56" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[56]</anchor-end> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">キャッシュ再利用</anchor>も参照。</comment-p></section><section><h1>歴史</h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="5" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[5]</anchor-end> <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><p><samp>RFC <del class="RFC2068">2068</del> <ins class="RFC2616">2616</ins></samp> のようにして差分を分かりやすく書いたはずだったのですが、段落の移動とかのせいでぐちゃぐちゃで却って分かりにくくなったような気がしています。ごめんんさい。</p><p>順序は RFC 2616 base なので、削除部分を読み飛ばせば 2616
として読むことができます。</p><p>目視で差分取りつつ merge してるので、うっかり落とした単語とかがあるかもしれません。原文も併せて参照して下さい。</p><figure class="quote"><figcaption><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2626" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[2626]</anchor-end> RFC <del class="RFC2068">2068</del> <ins class="RFC2616">2616</ins> (HTTP/1.1) 14.<del class="RFC2068">43</del><ins class="RFC2616">44</ins> Vary</figcaption><delete xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:"><blockquote xmlns="http://www.w3.org/1999/xhtml"><p>The Vary response-header field is used by a server to signal that the
response entity was selected from the available representations of
the response using server-driven negotiation (section 12). 
Field-names listed in Vary headers are those of request-headers. The Vary
field value indicates either that the given set of header fields
encompass the dimensions over which the representation might vary, or
that the dimensions of variance are unspecified (&quot;*&quot;) and thus may
vary over any aspect of future requests.</p></blockquote><p xmlns="http://www.w3.org/1999/xhtml"><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="1" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[1]</anchor-end> <code class="HTTP">Vary</code> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">応答頭欄</anchor>は、<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">鯖</anchor>が、応答<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">実体</anchor>は<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">サーバー駆動折衝</anchor>を使って利用可能な応答の<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">表現</anchor>から選択したことを通知するために使います。
<code class="HTTP">Vary</code> 頭欄に列挙される欄名は要求頭欄のものです。
<code class="HTTP">Vary</code> 頭欄の値は、その頭欄の集合が表現が変化し得る範囲を含むことも、
変化の範囲が未指定 (<code class="ABNF">&quot;*&quot;</code>)
で、従って将来の要求のどの角度によっても変化しうることをも示します。</p></delete><insert xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:"><blockquote xmlns="http://www.w3.org/1999/xhtml"><p>The Vary field value indicates the set of request-header fields that
fully determines, while the response is fresh, whether a cache is
permitted to use the response to reply to a subsequent request
without revalidation. For uncacheable or stale responses, the Vary
field value advises the user agent about the criteria that were used
to select the representation. A Vary field value of &quot;*&quot; implies that
a cache cannot determine from the request headers of a subsequent
request whether this response is the appropriate representation. See
section 13.6 for use of the Vary header field by caches.</p></blockquote><p xmlns="http://www.w3.org/1999/xhtml"><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="11" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[11]</anchor-end> <code class="HTTP">Vary</code> 欄の値は、
キャッシュが、要求が新鮮な間において、
再検証すること無しにその応答を後続の要求に返信するのに使うことが認められるかを完全に決定する要求頭欄の集合を示します。
キャッシュ不能であるか、又は新鮮でない応答に対しては、
<code class="HTTP">Vary</code> 欄の値は、
表現を選択するのに使われた基準を<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">利用者エージェント</anchor>に助言するものとなります。
<code class="HTTP">Vary</code> 欄の値 <code class="ABNF">&quot;*&quot;</code> は、キャッシュが、
この応答が後続の要求に対して適切な表現であるかどうかをその要求頭だけから決定出来ないことを示します。
キャッシュの <code class="HTTP">Vary</code> 
頭欄の使用については13.6節 <ins>(<anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="17" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;17</anchor-internal>)</ins> をご覧下さい。</p></insert><ul><li><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="12" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[12]</anchor-end> <code class="ABNF">Vary  = &quot;Vary&quot; &quot;:&quot; ( &quot;*&quot; | 1#field-name )</code></li></ul><blockquote><p>An HTTP/1.1 server <del class="RFC2068">MUST</del> <ins class="RFC2616">SHOULD</ins> 
include a<del class="RFC2068">n appropriate</del> 
Vary header field with any
cacheable response that is subject to server-driven negotiation.
Doing so allows a cache to properly interpret future requests on that
resource and informs the user agent about the presence of negotiation
on that resource. 
A server <del class="RFC2068">SHOULD</del> <ins class="RFC2616">MAY</ins>
include a<del class="RFC2068">n appropriate</del> 
Vary header field with a
non-cacheable response that is subject to server-driven negotiation,
since this might provide the user agent with useful information about
the dimensions over which the 
response <del class="RFC2068">might vary</del> <ins class="RFC2616">varies at the time of the response</ins>.</p></blockquote><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="13" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[13]</anchor-end> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">HTTP/1.1</anchor> サーバーは、サーバー駆動折衝の対象であるどんなキャッシュ可能な応答についても<del class="RFC2068">適切な</del>
<code class="HTTP">Vary</code> 頭欄を含め<del class="RFC2068">なければ<strong>なりません</strong></del><ins class="RFC2616">る<strong>べきです</strong></ins>。
そうすることで、キャッシュが将来の要求を適切に解釈することが出来ますし、利用者エージェントにその資源についての折衝があったことを知らせることとなります。
サーバーは、サーバー駆動折衝の対象であるキャッシュ可能でない資源についても、<del class="RFC2068">適切な</del>
<code class="HTTP">Vary</code> 頭欄を含め<del class="RFC2068">る<strong>べきです</strong></del><ins class="RFC2616">ても<strong>構いません</strong></ins>。
というのは、これによって、利用者エージェントに<del class="RFC2068">変化し得る</del><ins class="RFC2616">応答の時点での応答の変種の</ins>規模についての有用な情報を提供することが出来るのです。</p><insert xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:"><p xmlns="http://www.w3.org/1999/xhtml">(RFC 2068 では次は <anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="18" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;18</anchor-internal>)</p><p xmlns="http://www.w3.org/1999/xhtml">(RFC 2068 では <anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="16" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;16</anchor-internal> から次の段落に続く。)</p></insert><blockquote><p>A Vary field value consisting of a list of field-names signals that
the representation selected for the response is based on a selection
algorithm which considers ONLY the listed request-header field values
in selecting the most appropriate representation. A cache MAY assume
that the same selection will be made for future requests with the
same values for the listed field names, for the duration of time for
which the response is fresh.</p></blockquote><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="14" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[14]</anchor-end> <code class="HTTP">Vary</code> 欄の値は、欄名の一覧で構成します。
これは、最も適切な表現を選択するに当たって、
列挙された要求頭欄の値<strong>のみ</strong>を考慮する選択算法に基づいて、その応答の表現が選ばれたことを表します。
キャッシュは、応答が新鮮である時間内においては、
列挙された欄名に対して同じ値を持った将来の要求があった時に同じ選択がなされるものと仮定しても<strong>構いません</strong>。</p><blockquote><p>The field-names given are not limited to the set of standard
request-header fields defined by this specification. Field names are
case-insensitive.</p></blockquote><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="15" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[15]</anchor-end> 与える欄名はこの仕様書 <ins>(RFC 2616)</ins> 
で定義された標準の要求頭欄の集合には制限しません。
欄名は大文字・小文字を区別しません。</p><insert xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:"><p xmlns="http://www.w3.org/1999/xhtml">(RFC 2068 では <anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="15" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;15</anchor-internal> で 14.43 節は終わり。)</p><p xmlns="http://www.w3.org/1999/xhtml">(RFC 2068 では <anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="20" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;20</anchor-internal> から次の段落に続く。)</p></insert><blockquote><p>A Vary field value of &quot;*&quot; signals that unspecified parameters<del class="RFC2068">,</del> <del class="RFC2068">possibly other than the contents of</del> <ins class="RFC2616">not limited to the</ins> request-headers (e.g., the network address of the
client), play a role in the selection of the response representation. <del class="RFC2068">Subsequent requests on that resource can only be properly interpreted by the origin server, and thus a cache MUST forward a (possibly conditional) request even when it has a fresh response cached for the resource. See section 13.6 for use of the Vary header by caches.</del> <ins class="RFC2616">The &quot;*&quot; value MUST NOT be generated by a proxy server; it may only be generated by an origin server.</ins></p></blockquote><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="16" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[16]</anchor-end> <code class="HTTP">Vary</code> 欄の <code class="ABNF">&quot;*&quot;</code>
という値は、要求頭に限らない、記述されていない変数
(例えばクライアントのネットワーク・アドレス)
が応答の表現の選択に影響したことを表します。 <del class="RFC2068">この資源に対する後続の要求は、源サーバーによってのみ適切に解釈され得、従ってキャッシュは、その資源の新鮮な応答がキャッシュされていても、 (おそらく条件付で) 要求を転送しなければ<strong>なりません</strong>。</del>  <ins class="RFC2616">串サーバーは <code class="ABNF">&quot;*&quot;</code> という値を生成しては<strong>なりません</strong>。源サーバーのみがこの値を生成できます。</ins></p><insert xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:"><p xmlns="http://www.w3.org/1999/xhtml">(RFC 2068 では <anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="14" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;14</anchor-internal> に続く)</p></insert></figure><figure class="quote"><figcaption><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2627" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[2627]</anchor-end> RFC 2616 (HTTP/1.1) 13.6 Caching Negotiated Responses</figcaption><blockquote><p>Use of server-driven content negotiation (section 12<ins class="RFC2616">.1</ins>), as indicated
by the presence of a Vary header field in a response, alters the
conditions and procedure by which a cache can use the response for
subsequent requests. <ins class="RFC2616">See section 14.44 for use of the Vary header field by servers.</ins></p></blockquote><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="17" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[17]</anchor-end> サーバー駆動内容折衝を使用 (12<ins class="RFC2616">.1</ins>節)
することによって、 <code class="HTTP">Vary</code>
頭欄が応答中に現れることで示される通り、
キャッシュが後続の要求に対してその応答を使用することで状態と手続きが変更されます。 <ins class="RFC2616">サーバーによる <code class="HTTP">Vary</code> 頭欄の使用については 14.4 節 <ins>(<anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="11" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;11</anchor-internal>)</ins> をご覧下さい。</ins></p><delete xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:"><p xmlns="http://www.w3.org/1999/xhtml">(RFC 2068 での <anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="17" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;17</anchor-internal> の続き)</p><blockquote xmlns="http://www.w3.org/1999/xhtml"><p>A server MUST use the Vary header field (section 14.43) to inform a
cache of what header field dimensions are used to select among
multiple representations of a cachable response. A cache may use the
selected representation (the entity included with that particular
response) for replying to subsequent requests on that resource only
when the subsequent requests have the same or equivalent values for
all header fields specified in the Vary response-header. Requests
with a different value for one or more of those header fields would
be forwarded toward the origin server.</p><p>If an entity tag was assigned to the representation, the forwarded
request SHOULD be conditional and include the entity tags in an If-
None-Match header field from all its cache entries for the Request-
URI. This conveys to the server the set of entities currently held by
the cache, so that if any one of these entities matches the requested
entity, the server can use the ETag header in its 304 (Not Modified)
response to tell the cache which entry is appropriate. If the
entity-tag of the new response matches that of an existing entry, the
new response SHOULD be used to update the header fields of the
existing entry, and the result MUST be returned to the client.</p><p>The Vary header field may also inform the cache that the
representation was selected using criteria not limited to the
request-headers; in this case, a cache MUST NOT use the response in a
reply to a subsequent request unless the cache relays the new request
to the origin server in a conditional request and the server responds
with 304 (Not Modified), including an entity tag or Content-Location
that indicates which entity should be used.</p></blockquote><p xmlns="http://www.w3.org/1999/xhtml">(<anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="23" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;23</anchor-internal> に続く。)</p></delete><insert xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:"><p xmlns="http://www.w3.org/1999/xhtml">(RFC 2068 では <anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="13" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;13</anchor-internal> の後が次の段落。)</p></insert><blockquote><p><ins class="RFC2616">A server SHOULD use the Vary header field to inform a cache of what request-header fields were used to select among multiple representations of a cacheable response subject to server-driven negotiation.</ins> The set of header fields named by the Vary field value
is known as the &quot;selecting&quot; request-headers.</p></blockquote><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="18" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[18]</anchor-end> <ins class="RFC2616">サーバーは、サーバー駆動折衝の対象であってキャッシュ可能な応答の複数の表現から選ぶのにどの要求頭欄が使われたかをキャッシュに告げるために、 <code class="HTTP">Vary</code> 頭欄を使用する<strong>のが良い</strong>です。</ins>
<code class="HTTP">Vary</code> 欄の値に挙げられた頭欄の集合は
「選択」要求頭とも呼ばれます。</p><blockquote><p>When the cache receives a subsequent request whose Request-URI
specifies one or more cache entries including a Vary header <ins class="RFC2616">field</ins>,
the cache MUST NOT use such a cache entry to construct a response to
the new request unless all of the <ins class="RFC2616">selecting request-</ins>headers <del class="RFC2068">named in the cached Vary header are</del> present
in the new request <ins class="RFC2616">match the corresponding stored request-headers in
the original request</ins>.</p></blockquote><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="19" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[19]</anchor-end> <code class="ABNF">Request-URI</code> が <code class="HTTP">Vary</code>
頭<ins class="RFC2616">欄</ins>を含むキャッシュ項目を1つ以上指定している後続の要求をキャッシュが受信した時は、
キャッシュは新しい要求にある全ての<del class="RFC2068">キャッシュされた <code class="HTTP">Vary</code> 頭に名前が挙げられた</del><ins class="RFC2616">選択要求</ins>頭が<del class="RFC2068">出現する</del><ins class="RFC2616">保管している元の要求の対応する要求頭と一致する</ins>ので無い限り、
新しい要求への応答を構築するのにそのようなキャッシュ項目を使っては<strong>なりません</strong>。</p><blockquote><p>The selecting request-headers from two requests are defined to match
if and only if the selecting request-headers in the first request can
be transformed to the selecting request-headers in the second request
by adding or removing linear white space (LWS) at places where this
is allowed by the corresponding BNF, and/or combining multiple
message-header fields with the same field name following the rules
about message headers in section 4.2.</p></blockquote><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="20" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[20]</anchor-end> 二番目の要求の選択頭欄を、相当する BNF
で許されている箇所に置いて線形空白間隔 (LWS)
を追加したり削除したりすること<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">及び/又は</anchor>4.2節のメッセージ頭についての規則に従って同じ欄名の複数のメッセージ頭欄を結合することによって、最初の要求の選択頭欄に変形できる場合、
この場合に限って、2つの要求の選択要求頭は<DNF xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:">一致する</DNF>と定義します。</p><insert xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:"><p xmlns="http://www.w3.org/1999/xhtml">(RFC 2068 では <anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="16" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;16</anchor-internal> に続く)</p></insert><blockquote><p>A Vary header field-value of &quot;*&quot; always fails to match and subsequent
requests on that resource can only be properly interpreted by the
origin server.</p></blockquote><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="21" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[21]</anchor-end> <code class="HTTP">Vary</code> 頭欄の値が <code class="ABNF">&quot;*&quot;</code> の時には、
その資源への後続の要求は源サーバーによってのみ適切に解釈出来るので、
絶対に一致しません。</p><blockquote><p>If the selecting request header fields for the cached entry do not
match the selecting request header fields of the new request, then
the cache MUST NOT use a cached entry to satisfy the request unless
it first relays the new request to the origin server in a conditional
request and the server responds with 304 (Not Modified), including an
entity tag or Content-Location that indicates the entity to be used.</p></blockquote><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="22" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[22]</anchor-end> 新しい要求の選択要求頭欄がキャッシュされている項目の選択要求頭欄が一致しなければ、
キャッシュはその要求を満足させるのにキャッシュされた項目を使っては<strong>なりません</strong>。
但し、最初に新しい要求を源サーバーに条件付要求で中継して、
使用される実態を示す<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">実体札</anchor>又は <code class="HTTP">Content-Location</code>
を含んだ <code class="HTTP">304</code> (未修正) 
のサーバー応答を受け取った場合を除きます。</p><blockquote><p>If an entity tag was assigned to a cached representation, the
forwarded request SHOULD be conditional and include the entity tags
in an If-None-Match header field from all its cache entries for the
resource. This conveys to the server the set of entities currently
held by the cache, so that if any one of these entities matches the
requested entity, the server can use the ETag header field in its 304
(Not Modified) response to tell the cache which entry is appropriate.
If the entity-tag of the new response matches that of an existing
entry, the new response SHOULD be used to update the header fields of
the existing entry, and the result MUST be returned to the client.</p></blockquote><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="23" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[23]</anchor-end> キャッシュされた表現に実体札が割当てられていたなら、
転送する要求は条件付として、その資源のキャッシュ項目全ての実体札を
<code class="HTTP">If-None-Match</code> 頭欄に含める<strong>べきです</strong>。
これによってサーバーに現在キャッシュが保持している実体の集合を伝えることが出来て、
その実体のいずれかが要求された実体と一致していれば、サーバーは
<code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">304</anchor></code> (無修正) 応答に <code class="HTTP">ETag</code>
頭欄を使用することでキャッシュのどの実体が適切か教えることが出来ます。
新しい応答の実体札が既存の項目と一致したなら、
新しい応答は既存の項目の頭欄を更新するのに使う<strong>べき</strong>で、
その結果はクライアントに返さなければ<strong>なりません</strong>。</p><blockquote><p>If any of the existing cache entries contains only partial content
for the associated entity, its entity-tag SHOULD NOT be included in
the If-None-Match header <ins class="RFC2616">field</ins> unless the request is for a range that
would be fully satisfied by that entry.</p></blockquote><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="24" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[24]</anchor-end> 既存のキャッシュ項目のいずれかが関連付けられた実体の部分内容のみしか含んでいなければ、
その要求がその項目で十分満足される範囲に対するものでない限りは、
その実体札を <code class="HTTP">If-None-Match</code> 頭<ins class="RFC2616">欄</ins>に含める<strong>べきではありません</strong>。</p><blockquote><p>If a cache receives a successful response whose Content-Location
field matches that of an existing cache entry for the same 
Request-URI, whose entity-tag differs from that of the existing entry, and
whose Date is more recent than that of the existing entry, the
existing entry SHOULD NOT be returned in response to future requests
and SHOULD be deleted from the cache.</p></blockquote><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="25" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[25]</anchor-end> キャッシュが成功応答を受け取り、その 
<code class="HTTP">Content-Location</code> 欄が同じ <code class="ABNF">Request-URI</code>
に対する既存のキャッシュ項目のものと一致し、
その実体札は既存の項目のものとは異なるもので、
<code class="HTTP">Date</code> は既存の項目のものより最近であるのなら、
既存の項目は将来の要求の応答として返す<strong>べきではなく</strong>、
キャッシュから削除する<strong>べきです</strong>。</p></figure><figure class="quote"><figcaption><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2628" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[2628]</anchor-end> RFC 2295 (HTTP 透過内容折衝) 10.6 Elaborate Vary headers</figcaption><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="32" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[32]</anchor-end></p><blockquote><p>If a HTTP/1.1 [1] server can generate varying responses for a request
on some resource, then the server MUST include a Vary header in these
responses if they are cacheable.  This Vary header is a signal to
HTTP/1.1 caches that something special is going on.  It prevents the
caches from returning the currently chosen response for every future request on the resource.</p></blockquote><p>HTTP/1.1 サーバーがなんかの資源に対する要求で変化する応答を生成することができるときは、
サーバーはその応答が<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">キャッシュ可能</anchor>であれば 
<code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Vary</anchor></code> 頭を含めなければ<strong>なりません</strong>。
この <code class="HTTP">Vary</code> 頭は HTTP/1.1 キャッシュに何か特別なことをしているのだと通知します。
これによってキャッシュが現在選ばれた応答をその資源についての将来の要求に返さないようにします。</p><blockquote><p>Servers engaging in transparent content negotiation will generate
varying responses.  Therefore, cacheable list, choice, and adhoc
responses MUST always include a Vary header.</p></blockquote><blockquote><p>The most simple Vary header which can be included is<ul><li>Vary: *</li></ul></p></blockquote><blockquote><p>This header leaves the way in which the response is selected by the
server completely unspecified.</p></blockquote><blockquote><p>A more elaborate Vary header MAY be used to allow for certain
optimizations in HTTP/1.1 caches which do not have specific
optimizations for transparent content negotiation, but which do cache
multiple variant responses for one resource.  Such a more elaborate
Vary header lists all request headers which can be used by the server
when selecting a response for a request on the resource.</p></blockquote><p>より詳細な <code class="HTTP">Vary</code> 頭を使用して透過内容折衝には特に最適化しないけれども一つの資源についての複数の変種資源はキャッシュする
HTTP/1.1 キャッシュでの最適化を可能にしても<strong>構いません</strong>。
そのようなより詳細な <code class="HTTP">Vary</code> 頭は、サーバーがその資源についての要求に対する応答を選択するときに使用することが出来るすべての要求頭を列挙します。</p><section><h1>10.6.1 Construction of an elaborate Vary header</h1><blockquote><p>Origin servers can construct a more elaborate Vary header in the
following way.  First, start with the header</p></blockquote><p>起源サーバーは次の方法でより詳細な <code class="HTTP">Vary</code>
頭欄を構築できます。まず、頭</p><blockquote><ul><li>Vary: negotiate</li></ul></blockquote><blockquote><p>`negotiate' is always included because servers use the information in
the Negotiate header when choosing between a list, choice, or adhoc response.</p></blockquote><p>から始めます。 <code class="HTTP">negotiate</code> はサーバーが<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">目録応答</anchor>・<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">選択応答</anchor>・<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">臨時応答</anchor>を選ぶときに
<code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Negotiate</anchor></code> 頭の情報を使用するので、
常に含みます。</p><blockquote><p>Then, if any of the following attributes is present in any variant
description in the Alternates header, add the corresponding header
name to the Vary header</p></blockquote><p>それから、 <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>のいずれかに次の属性のどれかが示されていれば、
対応する頭名を <code class="HTTP">Vary</code> 頭に追加します。</p><blockquote><pre>         attribute  |   header name to add
         -----------+---------------------
          type      |   accept
          charset   |   accept-charset
          language  |   accept-language
          features  |   accept-features</pre></blockquote><blockquote><p>The Vary header constructed in this way specifies the response
variation which can be caused by the use of a variant selection
algorithm in proxies.  If the origin server will in some cases, for
example if contacted by a non-negotiating user agent, use a custom
negotiation algorithm which takes additional headers into account,
these names of these headers SHOULD also be added to the Vary header.</p></blockquote><p>この方法で構築された <code class="HTTP">Vary</code> 頭は串で変種選択算法を使用したときに起こり得る応答変種を指定します。
起源サーバーが、例えば非折衝利用者エージェントにより接触を受けた場合など幾つかの場合では、
追加の頭を考慮に入れた個別折衝算法を使用するのであれば、
その頭の名前も <code class="HTTP">Vary</code> 頭に追加する<strong>べきです</strong>。</p></section><section><h1>10.6.2 Caching of an elaborate Vary header</h1><blockquote><p>A proxy cache cannot construct an elaborate vary header using the
method above, because this method requires exact knowledge of any
custom algorithms present in the origin server.  However, when
extracting an Alternates header from a response (section 10.4) caches
MAY also extract the Vary header in the response, and reuse it along
with the Alternates header.  A clean Vary header can however only be
extracted if the variant does not vary itself, i.e. if a Variant-Vary header is absent.</p></blockquote><p>前述の方法は起源サーバーでどんな個別算法を使ったかの正確な知識が必要となるので、
この方法を使って串キャッシュが詳細な変化頭を構築することは出来ません。
しかし、応答から <code class="HTTP">Alternates</code> 頭を取り出すときには、
キャッシュは応答から <code class="HTTP">Vary</code>
頭をも取り出して、 <code class="HTTP">Alternates</code> 頭と一緒に再利用しても<strong>構いません</strong>。
しかし、綺麗な <code class="HTTP">Vary</code> 頭を取り出すことが出来るのは、
変種自体が変化しない時、つまり <code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Variant-Vary</anchor></code>
頭がないときだけです。</p></section></figure><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="26" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[26]</anchor-end> RFC 2616 は <code class="HTTP">Vary:</code> 欄の値になるものを<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">要求頭欄</anchor>に限定していますが、<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><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2617" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[2617]</anchor-end> <cite xml:lang="en">RFC 3143 - Known HTTP Proxy/Caching Problems</cite> (<time>2008-08-30 12:43:01 +09:00</time> 版) <anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="http://tools.ietf.org/html/rfc3143#section-2.1.1">http://tools.ietf.org/html/rfc3143#section-2.1.1</anchor-external></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2619" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[2619]</anchor-end> <cite>Apache HTTP Server Project</cite>
( (<time>2011-05-28 00:58:55 +09:00</time> 版))
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="http://httpd.apache.org/docs/1.3/misc/known_client_problems.html#ie40-vary">http://httpd.apache.org/docs/1.3/misc/known_client_problems.html#ie40-vary</anchor-external></p></section><section><h1>統計</h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2618" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[2618]</anchor-end> <cite xml:lang="en">HTTP/1.1 Vary header</cite> (<time>2009-07-19 11:40:34 +09:00</time> 版) <anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="http://www.http-stats.com/Vary">http://www.http-stats.com/Vary</anchor-external></p></section><section><h1>関連</h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="40" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[40]</anchor-end> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">透過内容折衝</anchor>では <code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Variant-Vary:</anchor></code> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ヘッダー</anchor>も使われます。
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">最善の異体</anchor>の <code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Vary:</anchor></code> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ヘッダー</anchor>は<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">選択応答</anchor>では
<code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Variant-Vary:</anchor></code> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ヘッダー</anchor>で返されます。</p></section><section><h1>メモ</h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="27" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[27]</anchor-end> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Apache</anchor> なんかは折衝をしたら <code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">negotiate</anchor></code> という謎の値を必ず送るんで、なんなのかなあと思うんですが、なんなんでしょう? 実質的に <code class="HTTP">*</code> と同じ意味になるわけですが。</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="31" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[31]</anchor-end> <anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="27" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;27</anchor-internal> HTTP 本体の仕様書だけ読んでると確かにそう思ってしまうのですが、 <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">RFC2295</anchor> で <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Negotiate:</anchor> という欄が規定されています。折衝時の <code class="HTTP">Vary:</code> 欄の使い方についても言及があるので、ぜひ読んでおきましょう。</p><ul><li><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="28" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[28]</anchor-end> <anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="12" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;12</anchor-internal> の構文だと、 <samp class="HTTP">Vary: <var>foo</var></samp> と別の欄で <samp class="HTTP">Vary: <var>bar</var></samp> にすることが出来ない (欄の値全体が <code class="ABNF">#</code> で定義されてはいないため。) のですが、ちょっとまずくありません?</li></ul><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="33" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[33]</anchor-end> 言語を折衝したときに <code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Content-Langage</anchor></code> を <code class="HTTP">Vary</code> に加えると間違って解説しているところがありますが、正しくは <code class="HTTP"><em>Accept</em>-Language</code> を加える、です。クライアントからの受入れ言語申告に基づき折衝するのですから。<weak xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">クライアントからの実体の言語に基づき折衝するという稀な場合は <code xmlns="http://www.w3.org/1999/xhtml" class="HTTP">Content-Language</code> で正しいですが、そんな場面ってあるでしょうか?</weak></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2620" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[2620]</anchor-end> <cite xml:lang="en">Building Smartphone-Optimized Websites - Webmasters — Google Developers</cite>
(<time>2012-06-07 02:56:13 +09:00</time> 版)
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://developers.google.com/webmasters/smartphone-sites/details">https://developers.google.com/webmasters/smartphone-sites/details</anchor-external></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2621" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[2621]</anchor-end> <cite xml:lang="en">Re: <strong></strong>[<strong></strong>XHR<strong></strong>]<strong></strong> Open issue: allow setting User-Agent?</cite>
( (<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Boris Zbarsky</anchor> 著, <time>2012-10-17 02:08:59 +09:00</time> 版))
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="http://lists.w3.org/Archives/Public/public-webapps/2012OctDec/0200.html">http://lists.w3.org/Archives/Public/public-webapps/2012OctDec/0200.html</anchor-external></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2622" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[2622]</anchor-end> <cite xml:lang="en">HTTP - WHATWG Wiki</cite>
( (<time>2012-11-08 09:54:29 +09:00</time> 版))
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="http://wiki.whatwg.org/wiki/HTTP#Assume_Vary:_User-Agent">http://wiki.whatwg.org/wiki/HTTP#Assume_Vary:_User-Agent</anchor-external></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2623" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[2623]</anchor-end> <cite>CORS and caches explained · fb04b72 · whatwg/fetch</cite>
( (<time>2014-05-21 03:26:24 +09:00</time> 版))
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://github.com/whatwg/fetch/commit/fb04b72c54fc14d487184c6716a0b0f15832d5c2">https://github.com/whatwg/fetch/commit/fb04b72c54fc14d487184c6716a0b0f15832d5c2</anchor-external></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2651" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[2651]</anchor-end> <cite xml:lang="en">RFC 7089 - HTTP Framework for Time-Based Access to Resource States -- Memento</cite>
( (<time>2014-10-05 16:32:34 +09:00</time> 版))
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="http://tools.ietf.org/html/rfc7089#section-2.1.2">http://tools.ietf.org/html/rfc7089#section-2.1.2</anchor-external></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="57" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[57]</anchor-end> <cite xml:lang="en">Fix #233: note that &quot;force-cache&quot; takes Vary into account · whatwg/fetch@4a71bba</cite>
(<time>2016-03-05 11:22:33 +09:00</time> 版)
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://github.com/whatwg/fetch/commit/4a71bba0f5f46fa58d0386936848b234fe8908aa">https://github.com/whatwg/fetch/commit/4a71bba0f5f46fa58d0386936848b234fe8908aa</anchor-external></p><figure class="quote"><figcaption><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="58" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[58]</anchor-end> <cite xml:lang="en">Web Annotation Protocol</cite>
(<time>2017-02-24 02:14:26 +09:00</time>)
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://w3c.github.io/web-annotation/protocol/wd/#h-annotation-retrieval">https://w3c.github.io/web-annotation/protocol/wd/#h-annotation-retrieval</anchor-external></figcaption><blockquote><p>For HEAD and GET requests, if the server supports content negotiation by format or JSON-LD profile, the response must have a Vary header with Accept in the value <strong>[</strong>rfc7231<strong>]</strong>. </p></blockquote></figure><figure class="quote"><figcaption><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="59" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[59]</anchor-end> <cite xml:lang="ja">動的な配信  |  Mobile Friendly Websites  |  Google Developers</cite>
(<time>2016-05-16 09:32:38 +09:00</time>)
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://developers.google.com/webmasters/mobile-sites/mobile-seo/dynamic-serving?hl=ja">https://developers.google.com/webmasters/mobile-sites/mobile-seo/dynamic-serving?hl=ja</anchor-external></figcaption><blockquote><p>Googlebot がモバイル端末向けのコンテンツを迅速に検出できるようになります。有効な Vary HTTP ヘッダーは、モバイル端末向けコンテンツを配信する URL をクロールする際に利用できるシグナルです。</p></blockquote></figure><figure class="quote"><figcaption><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="60" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[60]</anchor-end> <cite xml:lang="ja">その他のデバイスでのモバイル SEO  |  Mobile Friendly Websites  |  Google Developers</cite>
(<time>2017-01-05 18:51:14 +09:00</time>)
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://developers.google.com/webmasters/mobile-sites/mobile-seo/other-devices?hl=ja">https://developers.google.com/webmasters/mobile-sites/mobile-seo/other-devices?hl=ja</anchor-external></figcaption><blockquote><p>パソコンサイトにアクセスしたモバイル ユーザーをモバイルサイトに自動的にリダイレクトする場合(またはその逆の場合)は、Vary HTTP ヘッダーを含めるようにサーバーを必ず設定してください。</p></blockquote></figure><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="61" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[61]</anchor-end> <cite xml:lang="en">Advise `Vary` even for non-CORS-request responses</cite>
(<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">sideshowbarker</anchor>著, <time>2017-07-19 18:58:42 +09:00</time>)
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://github.com/whatwg/fetch/commit/194c2a135682d8cdcc35e31f4cb9466e1e160ebf">https://github.com/whatwg/fetch/commit/194c2a135682d8cdcc35e31f4cb9466e1e160ebf</anchor-external></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="62" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[62]</anchor-end> <cite xml:lang="en">Advise `Vary` even for non-CORS-request responses by sideshowbarker · Pull Request #564 · whatwg/fetch</cite>
(<time>2017-07-20 19:42:44 +09:00</time>)
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://github.com/whatwg/fetch/pull/564">https://github.com/whatwg/fetch/pull/564</anchor-external></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="63" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[63]</anchor-end> <cite xml:lang="en">682237 - Backing doesn't handle Vary header correctly</cite>
(<time>2017-08-24 16:53:12 +09:00</time>)
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://bugzilla.mozilla.org/show_bug.cgi?id=682237">https://bugzilla.mozilla.org/show_bug.cgi?id=682237</anchor-external></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="64" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[64]</anchor-end> <cite xml:lang="en">1274555 - Two versions of Cache for the same url?</cite>
(<time>2017-08-24 16:53:48 +09:00</time>)
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://bugzilla.mozilla.org/show_bug.cgi?id=1274555">https://bugzilla.mozilla.org/show_bug.cgi?id=1274555</anchor-external></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="65" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[65]</anchor-end> <cite xml:lang="en">RFC 3253 - Versioning Extensions to WebDAV (Web Distributed Authoring and Versioning)</cite>
(<time>2017-09-17 18:19:04 +09:00</time>)
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://tools.ietf.org/html/rfc3253#section-8.3">https://tools.ietf.org/html/rfc3253#section-8.3</anchor-external></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="66" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[66]</anchor-end> <cite xml:lang="en">Tracking Preference Expression (DNT)</cite>
(<time>2019-01-16 01:50:48 +09:00</time>)
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://www.w3.org/TR/2019/NOTE-tracking-dnt-20190117/#x7-4-4-caching">https://www.w3.org/TR/2019/NOTE-tracking-dnt-20190117/#x7-4-4-caching</anchor-external></p></section></body></html>