臨時応答

臨時応答

[14] 臨時応答 (adhoc response) は、透過内容折衝を正しく扱えないクライアントに向けた特別な応答です。

仕様書

構文

[9] 臨時応答TCN: adhoc を含まなければなりません >>7

[10] 臨時応答は、キャッシュ可能な場合には Vary: ヘッダーを含まなければなりません >>7。 これは通常のキャッシュ串が適切に取り扱えるようなものとするべきで、 Vary: * でも構いませんし、より詳細なものでも構いません >>7

[11] 臨時応答折衝可能資源に束縛された Alternates: ヘッダーを含んで構いません >>7

文脈

[8] 臨時応答は、リスト応答選択応答では透過内容折衝に対応しない、 あるいは不具合のあるクライアントと互換性が無くなってしまう場合に送ることができるものです >>7, >>4

[13] 例えば選択応答Location:Content-Location: の両方を含む 302 応答となるような場合、両ヘッダーがあると誤動作する利用者エージェントがあるなら、 Location: のみを含めた臨時応答を返すことができます。 >>7

処理モデル

[12] 臨時応答は、状態符号その他に依存してキャッシュ可能です >>7

歴史

[1] RFC 2295 2.2 抜粋

adhoc response
An adhoc response can be sent by an origin server as an extreme measure, to achieve compatibility with a non-negotiating or buggy client if this compatibility cannot be achieved by sending a list or choice response. There are very little requirements on the contents of an adhoc response. Adhoc responses are defined in section 10.3.

起源サーバーは、目録応答選択応答を送ることで折衝しないクライアントや蝕んだクライアントとの互換を達成できないときに、 この互換のために最後の手段として臨時応答を送ることができます。 臨時応答の内容には非常にわずかの要件があります。 臨時応答は10.3節で定義します。

[3] RFC 2295 (HTTP 透過内容折衝) 10.3 Adhoc response

An adhoc response can be sent by an origin server as an extreme measure, to achieve compatibility with a non-negotiating or buggy client if this compatibility cannot be achieved by sending a list or choice response. There are very little requirements on the contents of an adhoc response. An adhoc response MUST have a TCN header which specifies the "adhoc" response-type, and a Vary header if the response is cacheable. It MAY contain the Alternates header bound to the negotiable resource.

臨時応答は非折衝クライアントや蝕んだクライアントとの互換性達成が目録応答選択応答では不可能なときに最後の手段として起源サーバーが送ることが出来ます。 臨時応答の内容には非常にわずかの要件があります。 臨時応答は adhoc response-typeTCN 頭を持たなければならず、 応答がキャッシュ可能であれば Vary 頭も持たなければなりません。 臨時応答は折衝可能資源に束縛された Alternates 頭を含んでも構いません

Any Vary header in the response SHOULD ensure correct handling by plain HTTP/1.1 caching proxies. This header can either be

  • Vary: *

or a more elaborate header, see section 10.6.1. Depending on the status code, an adhoc response is cacheable unless indicated otherwise.

As an example of the use of an adhoc response, suppose that the variant resource "redirect-to-blah" yields redirection (302) responses. A choice response with this variant could look as follows:

     HTTP/1.1 302 Moved Temporarily
     Date: Tue, 11 Jun 1996 20:02:28 GMT
     TCN: choice
     Content-location: redirect-to-blah
     Location: http://blah.org/
     Content-Type: text/html
     Content-Length: 62

     This document is available <a href=http://blah.org/>here</a>.

Suppose that the server knows that the receiving user agent has a bug, which causes it to crash on responses which contain both a Content-Location and a Location header. The server could then work around this bug by performing a server-side override and sending the following adhoc response instead:

受信する利用者エージェントに虫がいて応答に Content-Location 頭と Location 頭があると狂うとサーバーが知っているとします。 このサーバーはサーバー側上書きを行って代わりに次の臨時応答を送ることでこの虫を避けることができるでしょう。

        HTTP/1.1 302 Moved Temporarily
        Date: Tue, 11 Jun 1996 20:02:28 GMT
        TCN: adhoc, keep
        Location: http://blah.org/
        Content-Type: text/html
        Content-Length: 62

        This document is available <a href=http://blah.org/>here</a>.

関連

[5] RFC 2295 には他にリスト応答選択応答があります。

メモ

[2] 臨時応答と訳すのと特別応答と訳すのと、どちらが適当かすごく迷うのですが・・・。 Special との区別ができる方がましかなあと思って今のところ臨時にしています。