[[#comment]] * 仕様書から ** RFC 1945 (HTTP/1.0); RFC 2068・2616 (HTTP/1.1) 10.3.5 304 Not Modified > If the client has performed a conditional GET request and access is allowed, but the document has not been modified [DEL[[DEL[{1945}]] since the date and time specified in the If-Modified-Since field]], the server [DEL[[DEL[{1945}]] must]] [INS[[DEL[{2068}]] SHOULD]] respond with this status code [DEL[[DEL[{1945}]] and not send an Entity-Body to the client]]. [INS[[DEL[{2068,2616}]] The [INS[304]] response MUST NOT contain a message-body[INS[, [INS[{2616}]] and thus is always terminated by the first empty line after the header fields]].]] [DEL[[DEL[{1945}]] 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.]] クライアントが条件付き [CODE(HTTP)[[[GET]]]] 要求を行い、接続は認められたものの、 文書は[DEL[[CODE(HTTP)[[[If-Modified-Since]]]] 欄に指定されて日付・時刻から]]修正されていないなら、 サーバーはこの状態符号で応答[DEL[してはならず、クライアントに [CODE(ABNF)[[[Entity-Body]]]] を送信してはなりません。]][INS[する'''べき'''です。]][INS[[CODE(HTTP)[304]] 応答は [CODE(ABNF)[[[message-body]]]] を含んでいては'''ならりません'''[INS[で、従って頭欄の後の最初の空行で常に終端します]]。]][DEL[応答中に含まれる頭欄はキャッシュ管理器に関係する情報又は実体の [CODE(HTTP)[[[Last-Modified]]]] 日付に独立して変わったかもしれない情報のみを含むべきです。関係する頭欄の例 : [CODE(HTTP)[[[Date]]]], [CODE(HTTP)[[[Server]]]], [CODE(HTTP)[[[Expires]]]]。キャッシュは、キャッシュした実体が [CODE(HTTP)[304]] 応答で与えられた新しい欄値を反映するように更新するべきです。]] [INS[ > [INS[{2068,2616}]] The response MUST include the following header fields: - Date[INS[, unless its omission is required by section 14.18.1]] 応答は次の頭欄を含まなければ'''なりません''': - [CODE(HTTP)[Date]] [INS[省略が義務付けられている場合を除く]] [INS[ > [INS[{2616}]] 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. 時計のない起源サーバーはこれらの規則に従い、 串及びクライアントが自身の [CODE(HTTP)[Date]] を [CODE(HTTP)[Date]] なしで受信した応答に付け加えれば、 キャッシュは正しく処理されます。 ]INS] > - ETag and/or Content-Location, if the header would have been sent in a 200 response to the same request - Expires, Cache-Control, and/or Vary, if the field-value might differ from that sent in any previous response for the same variant - [CODE(HTTP)[ETag]] [[及び/又は]] [CODE(HTTP)[[[Content-Location]]]] その頭が同じ要求に対する [CODE(HTTP)[[[200]]]] 応答でも送られるであろうなら - [CODE(HTTP)[[[Expires]]]], [CODE(HTTP)[[[Cache-Control]]]] 及び/又は [CODE(HTTP)[[[Vary]]]] 欄値が同じ変種に対する以前の応答で送られたものと異なるかもしれないなら > 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. 条件付き [CODE(HTTP)[GET]] が[[強いキャッシュ検証]]を使っているなら、 応答は他の実体頭欄を含む'''べきではありません'''。 そうでなければ、 (つまり条件付き [CODE(HTTP)[GET]] が弱い検証を使っているなら、) 応答は他の実体頭欄を含んでは'''なりません'''。 これによってキャッシュされている実体本体と更新された頭の不一致を防ぐことができます。 > If a 304 response indicates an entity not currently cached, then the cache MUST disregard the response and repeat the request without the conditional. [CODE(HTTP)[304]] 応答が実体は現在キャッシュされていないことを示すなら、 その時はキャッシュは応答を捨てて条件付きでない要求を繰り返さなければ'''なりません'''。 > 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. キャッシュが受信した [CODE(HTTP)[304]] 応答を使ってキャッシュ項目を更新するなら、 キャッシュは応答中に与えられた新しい欄値を反映して実体を更新しなければ'''なりません'''。 [DEL[ > [INS[{2068}]] The 304 response MUST NOT include a message-body, and thus is always terminated by the first empty line after the header fields. [CODE(HTTP)[304]] 応答は [CODE(ABNF)[[[message-body]]]] を含んでは'''ならず'''、 従って常に頭欄の後の最小の空行で終端します。 ]DEL] ]INS] ** RFC の部分の License [[RFCのライセンス]] * メモ [1] この応答符号、明らかに意味が他の [CODE(HTTP)[[[3xx]]]] と違いますよねえ。。。 [2] [CODE(DOMi)@en[[[XMLHttpRequest]]]]で[CODE(DOMa)@en[[[statusCode]]]]が[CODE(HTTP)@en[[[304]]]]になることがよくありますが、それを考慮していない使用例が多過ぎのような気がします。。。 ([[名無しさん]] [sage] [WEAK[2006-01-01 05:59:22 +00:00]])