[要約] RFC 8297は、ヒントを示すためのHTTPステータスコードを定義しています。その目的は、クライアントに対してサーバーからのヒントを提供することです。

Internet Engineering Task Force (IETF)                            K. Oku
Request for Comments: 8297                                        Fastly
Category: Experimental                                     December 2017
ISSN: 2070-1721
        

An HTTP Status Code for Indicating Hints

ヒントを示すHTTPステータスコード

Abstract

概要

This memo introduces an informational HTTP status code that can be used to convey hints that help a client make preparations for processing the final response.

このメモは、クライアントが最終応答を処理する準備をするのに役立つヒントを伝えるために使用できる情報HTTPステータスコードを紹介します。

Status of This Memo

本文書の状態

This document is not an Internet Standards Track specification; it is published for examination, experimental implementation, and evaluation.

このドキュメントはInternet Standards Trackの仕様ではありません。試験、実験、評価のために公開されています。

This document defines an Experimental Protocol for the Internet community. This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Not all documents approved by the IESG are a candidate for any level of Internet Standard; see Section 2 of RFC 7841.

このドキュメントでは、インターネットコミュニティの実験プロトコルを定義します。このドキュメントは、IETF(Internet Engineering Task Force)の製品です。これは、IETFコミュニティのコンセンサスを表しています。公開レビューを受け、インターネットエンジニアリングステアリンググループ(IESG)による公開が承認されました。 IESGによって承認されたすべてのドキュメントが、あらゆるレベルのインターネット標準の候補になるわけではありません。 RFC 7841のセクション2をご覧ください。

Information about the current status of this document, any errata, and how to provide feedback on it may be obtained at https://www.rfc-editor.org/info/rfc8297.

このドキュメントの現在のステータス、エラータ、およびフィードバックの提供方法に関する情報は、https://www.rfc-editor.org/info/rfc8297で入手できます。

Copyright Notice

著作権表示

Copyright (c) 2017 IETF Trust and the persons identified as the document authors. All rights reserved.

Copyright(c)2017 IETF Trustおよびドキュメントの作成者として識別された人物。全著作権所有。

This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.

この文書は、BCP 78およびIETF文書に関するIETFトラストの法的規定(https://trustee.ietf.org/license-info)の対象であり、この文書の発行日に有効です。これらのドキュメントは、このドキュメントに関するあなたの権利と制限について説明しているため、注意深く確認してください。このドキュメントから抽出されたコードコンポーネントには、Trust Legal Provisionsのセクション4.eに記載されているSimplified BSD Licenseのテキストが含まれている必要があり、Simplified BSD Licenseに記載されているように保証なしで提供されます。

Table of Contents

目次

   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   2
     1.1.  Notational Conventions  . . . . . . . . . . . . . . . . .   3
   2.  HTTP Status Code 103: Early Hints . . . . . . . . . . . . . .   3
   3.  Security Considerations . . . . . . . . . . . . . . . . . . .   5
   4.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .   6
   5.  References  . . . . . . . . . . . . . . . . . . . . . . . . .   6
     5.1.  Normative References  . . . . . . . . . . . . . . . . . .   6
     5.2.  Informative References  . . . . . . . . . . . . . . . . .   6
   Acknowledgements  . . . . . . . . . . . . . . . . . . . . . . . .   7
   Author's Address  . . . . . . . . . . . . . . . . . . . . . . . .   7
        
1. Introduction
1. はじめに

It is common for HTTP responses to contain links to external resources that need to be fetched prior to their use, for example, rendering HTML by a web browser. Having such links available to the client as early as possible helps to minimize perceived latency.

HTTP応答には、使用前にフェッチする必要がある外部リソースへのリンクが含まれているのが一般的です。たとえば、WebブラウザーによるHTMLのレンダリングなどです。クライアントがこのようなリンクをできるだけ早く使用できるようにすると、知覚される待ち時間を最小限に抑えることができます。

The "preload" [Preload] link relation can be used to convey such links in the Link header field of an HTTP response. However, it is not always possible for an origin server to generate the header block of a final response immediately after receiving a request. For example, the origin server might delegate a request to an upstream HTTP server running at a distant location, or the status code might depend on the result of a database query.

「プリロード」[プリロード]リンク関係を使用して、HTTP応答のリンクヘッダーフィールドでそのようなリンクを伝達できます。ただし、オリジンサーバーがリクエストを受け取った直後に最終応答のヘッダーブロックを生成することが常に可能であるとは限りません。たとえば、起点サーバーが離れた場所で実行されている上流のHTTPサーバーに要求を委任する場合や、ステータスコードがデータベースクエリの結果に依存する場合があります。

The dilemma here is that even though it is preferable for an origin server to send some header fields as soon as it receives a request, it cannot do so until the status code and the full header fields of the final HTTP response are determined.

ここでのジレンマは、オリジンサーバーがリクエストを受信するとすぐにいくつかのヘッダーフィールドを送信することが望ましいにもかかわらず、ステータスコードと最終的なHTTP応答の完全なヘッダーフィールドが決定されるまで送信できないことです。

HTTP/2 [RFC7540] server push can accelerate the delivery of resources, but only resources for which the server is authoritative. The other limitation of server push is that the response will be transmitted regardless of whether the client has the response cached. At the cost of spending one extra round trip compared to server push in the worst case, delivering Link header fields in a timely fashion is more flexible and might consume less bandwidth.

HTTP / 2 [RFC7540]サーバープッシュは、リソースの配信を高速化できますが、サーバーが信頼できるリソースのみです。サーバープッシュのもう1つの制限は、クライアントが応答をキャッシュしているかどうかに関係なく、応答が送信されることです。最悪の場合、サーバープッシュと比較して1回余分にラウンドトリップするという犠牲を払って、タイムリーな方法でリンクヘッダーフィールドを配信すると、より柔軟になり、消費する帯域幅が少なくなる可能性があります。

This memo defines a status code for sending an informational response ([RFC7231], Section 6.2) that contains header fields that are likely to be included in the final response. A server can send the informational response containing some of the header fields to help the client start making preparations for processing the final response, and then run time-consuming operations to generate the final response. The informational response can also be used by an origin server to trigger HTTP/2 server push at a caching intermediary.

このメモは、最終的な応答に含まれる可能性が高いヘッダーフィールドを含む情報応答([RFC7231]、セクション6.2)を送信するためのステータスコードを定義します。サーバーは、一部のヘッダーフィールドを含む情報応答を送信して、クライアントが最終応答の処理の準備を開始できるようにし、時間のかかる操作を実行して最終応答を生成できます。情報応答は、オリジンサーバーがキャッシング中間サーバーでHTTP / 2サーバープッシュをトリガーするためにも使用できます。

1.1. Notational Conventions
1.1. 表記規則

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.

キーワード「MUST」、「MUST NOT」、「REQUIRED」、「SHALL」、「SHALL NOT」、「SHOULD」、「SHOULD NOT」、「RECOMMENDED」、「NOT RECOMMENDED」、「MAY」、「OPTIONALこのドキュメントの「」は、BCP 14 [RFC2119] [RFC8174]で説明されているように解釈されます。

2. HTTP Status Code 103: Early Hints
2. HTTPステータスコード103:初期のヒント

The 103 (Early Hints) informational status code indicates to the client that the server is likely to send a final response with the header fields included in the informational response.

103(アーリーヒント)情報ステータスコードは、サーバーが情報応答に含まれるヘッダーフィールドを含む最終応答を送信する可能性が高いことをクライアントに示します。

Typically, a server will include the header fields sent in a 103 (Early Hints) response in the final response as well. However, there might be cases when this is not desirable, such as when the server learns that the header fields in the 103 (Early Hints) response are not correct before the final response is sent.

通常、サーバーは、103(アーリーヒント)応答で送信されたヘッダーフィールドを最終応答にも含めます。ただし、最終的な応答が送信される前にサーバーが103(アーリーヒント)応答のヘッダーフィールドが正しくないことを学習した場合など、これが望ましくない場合もあります。

A client can speculatively evaluate the header fields included in a 103 (Early Hints) response while waiting for the final response. For example, a client might recognize a Link header field value containing the relation type "preload" and start fetching the target resource. However, these header fields only provide hints to the client; they do not replace the header fields on the final response.

クライアントは、最終的な応答を待つ間、103(アーリーヒント)応答に含まれるヘッダーフィールドを投機的に評価できます。たとえば、クライアントは、関係タイプ「プリロード」を含むリンクヘッダーフィールド値を認識し、ターゲットリソースのフェッチを開始します。ただし、これらのヘッダーフィールドはクライアントにヒントを提供するだけです。最終応答のヘッダーフィールドは置き換えられません。

Aside from performance optimizations, such evaluation of the 103 (Early Hints) response's header fields MUST NOT affect how the final response is processed. A client MUST NOT interpret the 103 (Early Hints) response header fields as if they applied to the informational response itself (e.g., as metadata about the 103 (Early Hints) response).

パフォーマンスの最適化は別として、103(アーリーヒント)応答のヘッダーフィールドのこのような評価は、最終応答の処理方法に影響を与えてはなりません。クライアントは、103(Early Hints)応答ヘッダーフィールドを、情報応答自体に適用されたかのように(たとえば、103(Early Hints)応答に関するメタデータとして)解釈してはなりません(MUST NOT)。

A server MAY use a 103 (Early Hints) response to indicate only some of the header fields that are expected to be found in the final response. A client SHOULD NOT interpret the nonexistence of a header field in a 103 (Early Hints) response as a speculation that the header field is unlikely to be part of the final response.

サーバーは、103(アーリーヒント)応答を使用して、最終応答で見つかると予想されるヘッダーフィールドの一部のみを示すことができます(MAY)。クライアントは、103(アーリーヒント)応答にヘッダーフィールドが存在しないことを、ヘッダーフィールドが最終応答の一部である可能性が低いという推測として解釈してはなりません(SHOULD NOT)。

The following example illustrates a typical message exchange that involves a 103 (Early Hints) response.

次の例は、103(アーリーヒント)応答を含む一般的なメッセージ交換を示しています。

Client request:

クライアントのリクエスト:

GET / HTTP/1.1 Host: example.com

GET / HTTP / 1.1ホスト:example.com

Server response:

サーバーの応答:

     HTTP/1.1 103 Early Hints
     Link: </style.css>; rel=preload; as=style
     Link: </script.js>; rel=preload; as=script
        
     HTTP/1.1 200 OK
     Date: Fri, 26 May 2017 10:02:11 GMT
     Content-Length: 1234
     Content-Type: text/html; charset=utf-8
     Link: </style.css>; rel=preload; as=style
     Link: </script.js>; rel=preload; as=script
        

<!doctype html> [... rest of the response body is omitted from the example ...]

<!doctype html> [...応答本文の残りの部分は例から省略されています...]

As is the case with any informational response, a server might emit more than one 103 (Early Hints) response prior to sending a final response. This can happen, for example, when a caching intermediary generates a 103 (Early Hints) response based on the header fields of a stale-cached response, and then forwards a 103 (Early Hints) response and a final response that were sent from the origin server in response to a revalidation request.

情報応答の場合と同様に、サーバーは最終応答を送信する前に複数の103(早期ヒント)応答を発行する場合があります。これは、たとえば、キャッシング仲介者が古いキャッシュされた応答のヘッダーフィールドに基づいて103(アーリーヒント)応答を生成し、次に、103(アーリーヒント)応答と、再検証要求への応答としての起点サーバー。

A server MAY emit multiple 103 (Early Hints) responses with additional header fields as new information becomes available while the request is being processed. It does not need to repeat the fields that were already emitted, though it doesn't have to exclude them either. The client can consider any combination of header fields received in multiple 103 (Early Hints) responses when anticipating the list of header fields expected in the final response.

リクエストの処理中に新しい情報が利用可能になると、サーバーは複数の103(Early Hints)応答と追加のヘッダーフィールドを発行する場合があります。既に排出されたフィールドを繰り返す必要はありませんが、それらを除外する必要もありません。クライアントは、最終応答で予期されるヘッダーフィールドのリストを予測するときに、複数の103(アーリーヒント)応答で受信されるヘッダーフィールドの任意の組み合わせを検討できます。

The following example illustrates a series of responses that a server might emit. In the example, the server uses two 103 (Early Hints) responses to notify the client that it is likely to send three Link header fields in the final response. Two of the three expected header fields are found in the final response. The other header field is replaced by another Link header field that contains a different value.

次の例は、サーバーが発行する可能性がある一連の応答を示しています。この例では、サーバーは2つの103(アーリーヒント)応答を使用して、最終応答で3つのリンクヘッダーフィールドを送信する可能性が高いことをクライアントに通知します。予期される3つのヘッダーフィールドのうち2つは、最終応答で見つかります。他のヘッダーフィールドは、別の値を含む別のリンクヘッダーフィールドに置き換えられます。

     HTTP/1.1 103 Early Hints
     Link: </main.css>; rel=preload; as=style
        
     HTTP/1.1 103 Early Hints
     Link: </style.css>; rel=preload; as=style
     Link: </script.js>; rel=preload; as=script
        
     HTTP/1.1 200 OK
     Date: Fri, 26 May 2017 10:02:11 GMT
     Content-Length: 1234
     Content-Type: text/html; charset=utf-8
     Link: </main.css>; rel=preload; as=style
     Link: </newstyle.css>; rel=preload; as=style
     Link: </script.js>; rel=preload; as=script
        

<!doctype html> [... rest of the response body is omitted from the example ...]

<!doctype html> [...応答本文の残りの部分は例から省略されています...]

3. Security Considerations
3. セキュリティに関する考慮事項

Some clients might have issues handling a 103 (Early Hints) response, because informational responses are rarely used in reply to requests not including an Expect header field ([RFC7231], Section 5.1.1).

Expectヘッダーフィールドを含まないリクエストへの応答で情報応答が使用されることはほとんどないため、一部のクライアントでは103(アーリーヒント)応答の処理に問題がある可能性があります([RFC7231]、セクション5.1.1)。

In particular, an HTTP/1.1 client that mishandles an informational response as a final response is likely to consider all responses to the succeeding requests sent over the same connection to be part of the final response. Such behavior might constitute a cross-origin information disclosure vulnerability in case the client multiplexes requests to different origins onto a single persistent connection.

特に、情報応答を最終応答として誤って処理するHTTP / 1.1クライアントは、同じ接続を介して送信された後続の要求に対するすべての応答を最終応答の一部と見なす可能性があります。このような動作は、クライアントが異なる発信元へのリクエストを単一の永続的な接続に多重化する場合に、発信元間の情報漏えいの脆弱性を構成する可能性があります。

Therefore, a server might refrain from sending 103 (Early Hints) responses over HTTP/1.1 unless the client is known to handle informational responses correctly.

したがって、クライアントが情報応答を正しく処理することがわかっていない限り、サーバーはHTTP / 1.1を介して103(アーリーヒント)応答を送信しない場合があります。

HTTP/2 clients are less likely to suffer from incorrect framing since handling of the response header fields does not affect how the end of the response body is determined.

HTTP / 2クライアントは、応答ヘッダーフィールドの処理が応答本文の終わりの決定方法に影響しないため、不正なフレーミングの影響を受ける可能性が低くなります。

4. IANA Considerations
4. IANAに関する考慮事項

The following entry has been registered in the "HTTP Status Codes" registry:

次のエントリは、「HTTPステータスコード」レジストリに登録されています。

o Code: 103

o コード:103

o Description: Early Hints

o 説明:初期のヒント

o Specification: RFC 8297 (this document)

o 仕様:RFC 8297(このドキュメント)

5. References
5. 参考文献
5.1. Normative References
5.1. 引用文献

[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997, <https://www.rfc-editor.org/info/rfc2119>.

[RFC2119] Bradner、S。、「要件レベルを示すためにRFCで使用するキーワード」、BCP 14、RFC 2119、DOI 10.17487 / RFC2119、1997年3月、<https://www.rfc-editor.org/info/ rfc2119>。

[RFC7231] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content", RFC 7231, DOI 10.17487/RFC7231, June 2014, <https://www.rfc-editor.org/info/rfc7231>.

[RFC7231]フィールディング、R。、エド。およびJ. Reschke編、「Hypertext Transfer Protocol(HTTP / 1.1):Semantics and Content」、RFC 7231、DOI 10.17487 / RFC7231、2014年6月、<https://www.rfc-editor.org/info/rfc7231 >。

[RFC7540] Belshe, M., Peon, R., and M. Thomson, Ed., "Hypertext Transfer Protocol Version 2 (HTTP/2)", RFC 7540, DOI 10.17487/RFC7540, May 2015, <https://www.rfc-editor.org/info/rfc7540>.

[RFC7540] Belshe、M.、Peon、R。、およびM. Thomson、編、「Hypertext Transfer Protocol Version 2(HTTP / 2)」、RFC 7540、DOI 10.17487 / RFC7540、2015年5月、<https:// www.rfc-editor.org/info/rfc7540>。

[RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017, <https://www.rfc-editor.org/info/rfc8174>.

[RFC8174] Leiba、B。、「RFC 2119キーワードの大文字と小文字のあいまいさ」、BCP 14、RFC 8174、DOI 10.17487 / RFC8174、2017年5月、<https://www.rfc-editor.org/info/ rfc8174>。

5.2. Informative References
5.2. 参考引用

[Preload] Grigorik, I., Ed. and Y. Weiss, Ed., "Preload", W3C Candidate Recommendation, October 2017, <https://www.w3.org/TR/preload/>.

[プリロード]グリゴリック、I。、エド。 Y. Weiss、編、「Preload」、W3C Candidate Recommendation、2017年10月、<https://www.w3.org/TR/preload/>。

Acknowledgements

謝辞

Thanks to Tatsuhiro Tsujikawa for coming up with the idea of sending the Link header fields using an informational response.

情報応答を使用してリンクヘッダーフィールドを送信するというアイデアを思いついた辻川達弘に感謝します。

Mark Nottingham and Willy Tarreau provided substantial help in clarifying the semantics of the status code.

マークノッティンガムとウィリータローは、ステータスコードのセマンティクスを明確にするのに大きな助けを提供しました。

Early stages of the author's work on this document was supported by DeNA Co., Ltd. during his employment there.

このドキュメントに関する著者の作業の初期段階は、DeNA Co.、Ltd.での雇用中にサポートされました。

Author's Address

著者のアドレス

Kazuho Oku Fastly

かずほ おく ふぁstly

   Email: kazuhooku@gmail.com