[要約] RFC 8246は、HTTP Immutable Responsesの仕様を定義しています。この仕様の目的は、キャッシュの効率を向上させ、リソースの不変性を確保することです。

Internet Engineering Task Force (IETF)                        P. McManus
Request for Comments: 8246                                       Mozilla
Category: Standards Track                                 September 2017
ISSN: 2070-1721
        

HTTP Immutable Responses

HTTP不変応答

Abstract

概要

The immutable HTTP response Cache-Control extension allows servers to identify resources that will not be updated during their freshness lifetime. This ensures that a client never needs to revalidate a cached fresh resource to be certain it has not been modified.

HTTP応答のimmutable Cache-Control拡張により、サーバーは、鮮度保持期間中に更新されないリソースを識別できます。これにより、クライアントは、キャッシュされたフレッシュなリソースが変更されていないことを確認するために再検証を行う必要がなくなります。

Status of This Memo

本文書の状態

This is an Internet Standards Track document.

これはInternet Standards Trackドキュメントです。

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). Further information on Internet Standards is available in Section 2 of RFC 7841.

このドキュメントは、Internet Engineering Task Force (IETF) の成果物です。これは、IETFコミュニティのコンセンサスを表しています。公開レビューを受け、Internet Engineering Steering Group (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/rfc8246.

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

Copyright Notice

著作権表示

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

Copyright (c) 2017 IETF Trustおよび文書の著者として特定された人物。All rights reserved.

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.  The Immutable Cache-Control Extension . . . . . . . . . . . .   3
     2.1.  About Intermediaries  . . . . . . . . . . . . . . . . . .   4
     2.2.  Example . . . . . . . . . . . . . . . . . . . . . . . . .   4
   3.  Security Considerations . . . . . . . . . . . . . . . . . . .   4
   4.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .   5
   5.  References  . . . . . . . . . . . . . . . . . . . . . . . . .   5
     5.1.  Normative References  . . . . . . . . . . . . . . . . . .   5
     5.2.  Informative References  . . . . . . . . . . . . . . . . .   5
   Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . .   6
   Author's Address  . . . . . . . . . . . . . . . . . . . . . . . .   6
        
1. Introduction
1. はじめに

HTTP's freshness lifetime mechanism [RFC7234] allows a client to safely reuse a stored response to satisfy future requests for a specified period of time. However, it is still possible that the resource will be modified during that period.

HTTPの鮮度保持期間のメカニズム[RFC7234]により、クライアントは、保存された応答を安全に再利用して、指定された期間、将来のリクエストを満たすことができます。ただし、その期間中にリソースが変更される可能性があります。

For instance, a front-page newspaper photo with a freshness lifetime of one hour would mean that no user would see a cached photo more than one hour old. However, the photo could be updated at any time, resulting in different users seeing different photos depending on the contents of their caches for up to one hour. This is compliant with the caching mechanism defined in [RFC7234].

たとえば、鮮度保持期間が1時間の新聞の一面の写真は、ユーザーが1時間以上前のキャッシュされた写真を見ることはないことを意味します。ただし、写真はいつでも更新できるため、キャッシュの内容に応じて、異なるユーザーに異なる写真が最大1時間表示されます。これは、[RFC7234]で定義されているキャッシングメカニズムに準拠しています。

Users that need to confirm there have been no updates to their cached responses typically use the reload (or refresh) mechanism in their user agents. This in turn generates a conditional request [RFC7232], and either a new representation or, if unmodified, a 304 (Not Modified) response [RFC7232] is returned. A user agent that understands HTML and fetches its dependent sub-resources might issue hundreds of conditional requests to refresh all portions of a common page [REQPERPAGE].

キャッシュされた応答が更新されていないことを確認する必要があるユーザーは、通常、ユーザーエージェントで再読み込み(または更新)メカニズムを使用します。これにより、条件付きリクエスト[RFC7232]が生成され、新しい表現か、変更されていない場合は304(Not Modified)レスポンス[RFC7232]が返されます。 HTMLを理解し、その従属サブリソースをフェッチするユーザーエージェントは、何百もの条件付きリクエストを発行して、共通ページのすべての部分をリフレッシュする場合があります[REQPERPAGE]。

However, some content providers never create more than one variant of a sub-resource, because they use "versioned" URLs. When these resources need an update, they are simply published under a new URL, typically embedding an identifier unique to that version of the resource in the path, and references to the sub-resource are updated with the new path information.

ただし、一部のコンテンツプロバイダーは「バージョン管理された」URLを使用するため、サブリソースのバリアントを複数作成することはありません。これらのリソースを更新する必要がある場合、それらは新しいURLで公開され、通常、そのバージョンのリソースに固有の識別子がパスに埋め込まれ、サブリソースへの参照は新しいパス情報で更新されます。

For example, "https://www.example.com/101016/main.css" might be updated and republished as "https://www.example.com/102026/main.css", with any links that reference it being changed at the same time.

たとえば、「https://www.example.com/101016/main.css」が更新されて「https://www.example.com/102026/main.css」として再公開されると同時に、それを参照するリンクも変更されます。

This design pattern allows a very large freshness lifetime to be used for the sub-resource without guessing when it will be updated in the future.

この設計パターンにより、将来更新される時期を推測することなく、非常に長い鮮度保持期間をサブリソースに使用できます。

Unfortunately, the user agent does not know when this versioned URL design pattern is used. As a result, user-driven refreshes still translate into wasted conditional requests for each sub-resource as each will return 304 responses.

残念ながら、ユーザーエージェントは、このバージョン管理されたURLデザインパターンがいつ使用されるかを知りません。その結果、ユーザー主導の更新は、各サブリソースが304応答を返すため、各サブリソースの無駄な条件付きリクエストにつながります。

The immutable HTTP response Cache-Control extension allows servers to identify responses that will not be updated during their freshness lifetimes.

HTTP応答のimmutable Cache-Control拡張を使用すると、サーバーは、鮮度保持期間中に更新されない応答を識別できます。

This effectively informs clients that any conditional request for that response can be safely skipped without worrying that it has been updated.

これにより、その応答に対する条件付きリクエストは、更新されていることを心配することなく安全にスキップできることをクライアントに効果的に通知します。

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. The Immutable Cache-Control Extension
2. Immutable Cache-Control拡張

When present in an HTTP response, the immutable Cache-Control extension indicates that the origin server will not update the representation of that resource during the freshness lifetime of the response.

HTTP応答に存在する場合、immutable Cache-Control拡張は、オリジンサーバーが応答の鮮度保持期間中にそのリソースの表現を更新しないことを示します。

Clients SHOULD NOT issue a conditional request during the response's freshness lifetime (e.g., upon a reload) unless explicitly overridden by the user (e.g., a force reload).

クライアントは、ユーザーによって明示的にオーバーライドされない限り(強制リロードなど)、応答の鮮度保持期間中(リロード時など)に条件付きリクエストを発行してはなりません(SHOULD NOT)。

The immutable extension only applies during the freshness lifetime of the stored response. Stale responses SHOULD be revalidated as they normally would be in the absence of the immutable extension.

immutable拡張は、保存された応答の鮮度保持期間中にのみ適用されます。古くなった応答は、immutable拡張がない場合に通常行われるように、再検証する必要があります(SHOULD)。

The immutable extension takes no arguments. If any arguments are present, they have no meaning and MUST be ignored. Multiple instances of the immutable extension are equivalent to one instance. The presence of an immutable Cache-Control extension in a request has no effect.

immutable拡張は引数を取りません。引数が存在する場合、それらには意味がなく、無視しなければなりません(MUST)。immutable拡張の複数のインスタンスは、1つのインスタンスに相当します。リクエストにimmutable Cache-Control拡張が存在しても効果はありません。

2.1. About Intermediaries
2.1. 仲介業者について

An immutable response has the same semantic meaning when received by proxy clients as it does when received by user-agent-based clients. Therefore, proxies SHOULD skip conditionally revalidating fresh responses containing the immutable extension unless there is a signal from the client that a validation is necessary (e.g., a no-cache Cache-Control request directive defined in Section 5.2.1.4 of [RFC7234]).

immutable応答は、ユーザーエージェントベースのクライアントが受信した場合と同じように、プロキシクライアントが受信した場合と同じ意味を持ちます。したがって、検証が必要であるというクライアントからのシグナル(たとえば、[RFC7234]のセクション5.2.1.4で定義されているno-cache Cache-Controlリクエストディレクティブなど)がない限り、プロキシはimmutable拡張を含むフレッシュな応答の条件付き再検証をスキップする必要があります(SHOULD)。

A proxy that uses the immutable extension to bypass a conditional revalidation can choose whether to reply with a 304 or 200 response to its requesting client based on the request headers the proxy received.

immutable拡張を使用して条件付き再検証をバイパスするプロキシは、プロキシが受信したリクエストヘッダーに基づいて、リクエスト元のクライアントに304または200応答を返すかどうかを選択できます。

2.2. Example
2.2. 例

Cache-Control: max-age=31536000, immutable

Cache-Control: max-age=31536000, immutable

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

The immutable mechanism acts as form of soft pinning and, as with all pinning mechanisms, creates a vector for amplification of cache corruption incidents. These incidents include cache-poisoning attacks. Three mechanisms are suggested for mitigation of this risk:

immutableメカニズムは、ソフトピン留めの一形態として機能し、すべてのピン留めメカニズムと同様に、キャッシュ破損インシデントを増幅するためのベクトルを作成します。これらのインシデントには、キャッシュポイズニング攻撃が含まれます。このリスクを軽減するために3つのメカニズムが提案されています。

o Clients SHOULD ignore the immutable extension from resources that are not part of an authenticated context such as HTTPS. Authenticated resources are less vulnerable to cache poisoning.

o クライアントは、HTTPSなどの認証済みコンテキストの一部ではないリソースからのimmutable拡張を無視する必要があります(SHOULD)。認証されたリソースは、キャッシュポイズニングに対してそれほど脆弱ではありません。

o User agents often provide two different refresh mechanisms: reload and some form of force-reload. The latter is used to rectify interrupted loads and other corruption. These reloads, typically indicated through no-cache request attributes, SHOULD ignore the immutable extension as well.

o ユーザーエージェントは、多くの場合、2つの異なる更新メカニズムを提供します。リロードと何らかの形式の強制リロードです。後者は、中断されたロードやその他の破損を修正するために使用されます。これらのリロードは、通常、no-cacheリクエスト属性によって示され、immutable拡張も無視する必要があります(SHOULD)。

o Clients SHOULD ignore the immutable extension for resources that do not provide a strong indication that the stored response size is the correct response size such as responses delimited by connection close.

o クライアントは、保存された応答サイズが、接続のクローズによって区切られた応答などの正しい応答サイズであることを示す強力な指標を提供しないリソースのimmutable拡張を無視する必要があります(SHOULD)。

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

The immutable extension has been registered in the "Hypertext Transfer Protocol (HTTP) Cache Directive Registry" per the guidelines described in Section 7.1 of [RFC7234].

immutable拡張は、[RFC7234]のセクション7.1で説明されているガイドラインに従って、「Hypertext Transfer Protocol (HTTP) Cache Directive Registry」に登録されています。

o Cache Directive: immutable

o Cache Directive: immutable

o Reference: RFC 8246

o リファレンス:RFC 8246

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., "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>.

[RFC7232] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer Protocol (HTTP/1.1): Conditional Requests", RFC 7232, DOI 10.17487/RFC7232, June 2014, <https://www.rfc-editor.org/info/rfc7232>.

[RFC7232] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer Protocol (HTTP/1.1): Conditional Requests", RFC 7232, DOI 10.17487/RFC7232, June 2014, <https://www.rfc-editor.org/info/rfc7232>.

[RFC7234] Fielding, R., Ed., Nottingham, M., Ed., and J. Reschke, Ed., "Hypertext Transfer Protocol (HTTP/1.1): Caching", RFC 7234, DOI 10.17487/RFC7234, June 2014, <https://www.rfc-editor.org/info/rfc7234>.

[RFC7234] Fielding, R., Ed., Nottingham, M., Ed., and J. Reschke, Ed., "Hypertext Transfer Protocol (HTTP/1.1): Caching", RFC 7234, DOI 10.17487/RFC7234, June 2014, <https://www.rfc-editor.org/info/rfc7234>.

[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., "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>.

5.2. Informative References
5.2. 参考引用

[REQPERPAGE] HTTP Archive, "Total Requests per Page", <http://httparchive.org/interesting.php#reqTotal>.

[REQPERPAGE] HTTP Archive, "Total Requests per Page", <http://httparchive.org/interesting.php#reqTotal>.

Acknowledgments

謝辞

Thank you to Ben Maurer for partnership in developing and testing this idea. Thank you to Amos Jeffries for help with proxy interactions and to Mark Nottingham for help with the documentation.

このアイデアの開発とテストに協力してくれたBen Maurerに感謝します。プロキシの相互作用についてはAmos Jeffriesに、ドキュメントについてはMark Nottinghamに感謝します。

Author's Address

著者のアドレス

Patrick McManus Mozilla

Patrick McManus Mozilla

   Email: mcmanus@ducksong.com