<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="18" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[18]</anchor-end> <dfn><code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">304</anchor></code></dfn> (<dfn><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Not Modified</anchor></dfn>) は、
<code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">If-Modified-Since:</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>です。</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="7" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[7]</anchor-end> <strong><cite xml:lang="en">RFC 7232 - Hypertext Transfer Protocol (HTTP/1.1): Conditional Requests</cite> (<time>2014-09-11 10:02: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://tools.ietf.org/html/rfc7232#section-4.1">https://tools.ietf.org/html/rfc7232#section-4.1</anchor-external></strong></li><li><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="305" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[305]</anchor-end> <cite xml:lang="en">RFC 7230 - Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing</cite> (<time>2014-06-07 01:59:35 +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/rfc7230#section-3.3">https://tools.ietf.org/html/rfc7230#section-3.3</anchor-external></li><li><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> <cite xml:lang="en">RFC 7232 - Hypertext Transfer Protocol (HTTP/1.1): Conditional Requests</cite> (<time>2014-09-11 10:02: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://tools.ietf.org/html/rfc7232#section-3.2">https://tools.ietf.org/html/rfc7232#section-3.2</anchor-external></li><li><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> <cite xml:lang="en">RFC 7232 - Hypertext Transfer Protocol (HTTP/1.1): Conditional Requests</cite> (<time>2014-09-11 10:02: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://tools.ietf.org/html/rfc7232#section-3.3">https://tools.ietf.org/html/rfc7232#section-3.3</anchor-external></li><li><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> <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-8.5">http://tools.ietf.org/html/rfc2295#section-8.5</anchor-external></li></ul></refs></section><section><h1>意味</h1><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> は、<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:">GET</anchor></code> や
<code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">HEAD</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"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">200</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>です <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="7" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;7</anchor-internal></src>。</p><p><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> これはすなわち、<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"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">200</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:">payload</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="7" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;7</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="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:">HTTPリダイレクト</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>」に分類されています。</comment-p></section><section><h1>構文</h1><p><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"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">304</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"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">200</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:"><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="7" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;7</anchor-internal></src>。<figure class="short list"><ul><li><code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Cache-Control:</anchor></code></li><li><code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Content-Location:</anchor></code></li><li><code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Date:</anchor></code></li><li><code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ETag:</anchor></code></li><li><code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Expires:</anchor></code></li><li><code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Vary:</anchor></code></li></ul></figure></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="17" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[17]</anchor-end> <code xmlns="http://www.w3.org/1999/xhtml" class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">200</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="22" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[22]</anchor-end> <code xmlns="http://www.w3.org/1999/xhtml" class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">206</anchor></code> でも同様の規定があります。</comment-p><p><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> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">送信者</anchor>は、 <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> 以外の<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="7" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;7</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="13" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[13]</anchor-end> 例えば <code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Last-Modified:</anchor></code> は <code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ETag:</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="7" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;7</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="14" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[14]</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:">Pragma:</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="19" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[19]</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:">If-Modified-Since:</anchor></code> に対する<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">応答</anchor>として <code xmlns="http://www.w3.org/1999/xhtml" class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">304</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:"><strong xmlns="http://www.w3.org/1999/xhtml">べき</strong></anchor> <src><anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="6" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;6</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:">RFC</anchor> としては一般的な品質なので、
一々気にするだけ無駄でしょう。)</comment-p><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" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">TCN:</anchor></code> は<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:">304</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="15" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;15</anchor-internal></src>。</p><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> これらの<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ヘッダー</anchor>についての情報は、 <anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="21" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;21</anchor-internal> の <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">JSON</anchor>
ファイルの <code>304_representation_metadata</code> に含まれています。<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="21" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[21]</anchor-end> <cite xml:lang="en">data-web-defs/headers.txt at master · manakai/data-web-defs</cite> (<time>2014-09-15 14:34:53 +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/manakai/data-web-defs/blob/master/doc/headers.txt">https://github.com/manakai/data-web-defs/blob/master/doc/headers.txt</anchor-external></li></ul></refs></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="306" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[306]</anchor-end> <code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">304</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>を持ちません <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="305" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;305</anchor-internal>, <anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="7" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;7</anchor-internal></src>。</p></section><section><h1>文脈</h1><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> <code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">If-None-Match:</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:">GET</anchor></code> か <code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">HEAD</anchor></code> の場合には、
<code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">304</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="3" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;3</anchor-internal></src>。</p><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> <code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">If-Modified-Since:</anchor></code> の条件を満たさない場合には、
<code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">304</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="6" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;6</anchor-internal></src>。</p></section><section><h1>処理モデル</h1><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> <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><section><h1>歴史</h1><figure class="quote"><figcaption><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="307" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[307]</anchor-end> RFC 1945 (HTTP/1.0); RFC 2068・2616 (HTTP/1.1) 10.3.5 304 Not Modified</p></figcaption><blockquote><p>If the client has performed a conditional GET request and access is
allowed, but the document has not been modified <del><del>{1945}</del> since the date and time specified in the If-Modified-Since field</del>,
the server <del><del>{1945}</del> must</del> <ins><del>{2068}</del> SHOULD</ins> respond with this status code <del><del>{1945}</del> and not send an Entity-Body to the client</del>. <ins><del>{2068,2616}</del> The <ins>304</ins> response MUST NOT contain a message-body<ins>, <ins>{2616}</ins> and thus is always terminated by the first empty line after the header fields</ins>.</ins> <del><del>{1945}</del> Header fields contained in the response should only include information which is relevant to cache managers or which may have changed independently of the entity's Last-Modified date. Examples of relevant header fields include: Date, Server, and Expires. A cache should update its cached entity to reflect any new field values given in the 304 response.</del></p></blockquote><p>クライアントが条件付き <code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">GET</anchor></code> 要求を行い、接続は認められたものの、
文書は<del><code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">If-Modified-Since</anchor></code> 欄に指定されて日付・時刻から</del>修正されていないなら、
サーバーはこの状態符号で応答<del>してはならず、クライアントに <code class="ABNF"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Entity-Body</anchor></code> を送信してはなりません。</del><ins>する<strong>べき</strong>です。</ins><ins><code class="HTTP">304</code> 応答は <code class="ABNF"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">message-body</anchor></code> を含んでいては<strong>ならりません</strong><ins>で、従って頭欄の後の最初の空行で常に終端します</ins>。</ins><del>応答中に含まれる頭欄はキャッシュ管理器に関係する情報又は実体の <code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Last-Modified</anchor></code> 日付に独立して変わったかもしれない情報のみを含むべきです。関係する頭欄の例 : <code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Date</anchor></code>, <code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Server</anchor></code>, <code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Expires</anchor></code>。キャッシュは、キャッシュした実体が <code class="HTTP">304</code> 応答で与えられた新しい欄値を反映するように更新するべきです。</del></p><insert xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:"><blockquote xmlns="http://www.w3.org/1999/xhtml"><p><ins>{2068,2616}</ins>  The response MUST include the following header fields:<ul><li>Date<ins>, unless its omission is required by section 14.18.1</ins></li></ul></p></blockquote><p xmlns="http://www.w3.org/1999/xhtml">応答は次の頭欄を含まなければ<strong>なりません</strong>:<ul><li><code class="HTTP">Date</code> <ins>省略が義務付けられている場合を除く</ins></li></ul></p><insert><blockquote xmlns="http://www.w3.org/1999/xhtml"><p><ins>{2616}</ins> If a clockless origin server obeys these rules, and proxies and
clients add their own Date to any response received without one (as
already specified by [RFC 2068], section 14.19), caches will operate correctly.</p></blockquote><p xmlns="http://www.w3.org/1999/xhtml">時計のない起源サーバーはこれらの規則に従い、
串及びクライアントが自身の <code class="HTTP">Date</code> を <code class="HTTP">Date</code>
なしで受信した応答に付け加えれば、
キャッシュは正しく処理されます。</p></insert><blockquote xmlns="http://www.w3.org/1999/xhtml"><ul><li>ETag and/or Content-Location, if the header would have been sent in
a 200 response to the same request</li><li>Expires, Cache-Control, and/or Vary, if the field-value might
differ from that sent in any previous response for the same variant</li></ul></blockquote><ul xmlns="http://www.w3.org/1999/xhtml"><li><code class="HTTP">ETag</code> <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:">Content-Location</anchor></code>
その頭が同じ要求に対する <code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">200</anchor></code> 応答でも送られるであろうなら</li><li><code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Expires</anchor></code>, <code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Cache-Control</anchor></code>
及び/又は <code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Vary</anchor></code> 
欄値が同じ変種に対する以前の応答で送られたものと異なるかもしれないなら</li></ul><blockquote xmlns="http://www.w3.org/1999/xhtml"><p>If the conditional GET used a strong cache validator (see section
13.3.3), the response SHOULD NOT include other entity-headers.
Otherwise (i.e., the conditional GET used a weak validator), the
response MUST NOT include other entity-headers; this prevents
inconsistencies between cached entity-bodies and updated headers.</p></blockquote><p xmlns="http://www.w3.org/1999/xhtml">条件付き <code class="HTTP">GET</code> が<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">強いキャッシュ検証</anchor>を使っているなら、
応答は他の実体頭欄を含む<strong>べきではありません</strong>。
そうでなければ、 (つまり条件付き <code class="HTTP">GET</code> が弱い検証を使っているなら、)
応答は他の実体頭欄を含んでは<strong>なりません</strong>。
これによってキャッシュされている実体本体と更新された頭の不一致を防ぐことができます。</p><blockquote xmlns="http://www.w3.org/1999/xhtml"><p>If a 304 response indicates an entity not currently cached, then the
cache MUST disregard the response and repeat the request without the conditional.</p></blockquote><p xmlns="http://www.w3.org/1999/xhtml"><code class="HTTP">304</code> 応答が実体は現在キャッシュされていないことを示すなら、
その時はキャッシュは応答を捨てて条件付きでない要求を繰り返さなければ<strong>なりません</strong>。</p><blockquote xmlns="http://www.w3.org/1999/xhtml"><p>If a cache uses a received 304 response to update a cache entry, the
cache MUST update the entry to reflect any new field values given in the response.</p></blockquote><p xmlns="http://www.w3.org/1999/xhtml">キャッシュが受信した <code class="HTTP">304</code> 応答を使ってキャッシュ項目を更新するなら、
キャッシュは応答中に与えられた新しい欄値を反映して実体を更新しなければ<strong>なりません</strong>。</p><delete><blockquote xmlns="http://www.w3.org/1999/xhtml"><p><ins>{2068}</ins> The 304 response MUST NOT include a message-body, and thus is always
terminated by the first empty line after the header fields.</p></blockquote><p xmlns="http://www.w3.org/1999/xhtml"><code class="HTTP">304</code> 応答は <code class="ABNF"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">message-body</anchor></code> を含んでは<strong>ならず</strong>、
従って常に頭欄の後の最小の空行で終端します。</p></delete></insert></figure></section><section><h1>メモ</h1><p><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"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">3xx</anchor></code> 
と違いますよねえ。。。</p><p><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>
<code class="DOMi" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">XMLHttpRequest</anchor></code>で<code class="DOMa" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">statusCode</anchor></code>が<code class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">304</anchor></code>になることがよくありますが、それを考慮していない使用例が多過ぎのような気がします。。。
(<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">名無しさん</anchor> [sage] <weak xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">2006-01-01 05:59:22 +00:00</weak>)</p><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> <cite xml:lang="en">Close #141: fix 304 handling · whatwg/fetch@1a2f6b4</cite>
(<time>2015-11-01 19:39:10 +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/1a2f6b49d616cfd74536c1a8dbed8b5c1215d548">https://github.com/whatwg/fetch/commit/1a2f6b49d616cfd74536c1a8dbed8b5c1215d548</anchor-external></p></section></body></html>