Independent Submission M. Nottingham Request for Comments: 5861 Yahoo! Inc. Category: Informational May 2010 ISSN: 2070-1721
HTTP Cache-Control Extensions for Stale Content
Abstract
抽象
This document defines two independent HTTP Cache-Control extensions that allow control over the use of stale responses by caches.
この文書では、キャッシュによって古くなったレスポンスの使用を制御するための2つの独立したHTTPのCache-Controlの拡張機能を定義します。
Status of This Memo
このメモのステータス
This document is not an Internet Standards Track specification; it is published for informational purposes.
このドキュメントはインターネット標準化過程仕様ではありません。それは、情報提供の目的のために公開されています。
This is a contribution to the RFC Series, independently of any other RFC stream. The RFC Editor has chosen to publish this document at its discretion and makes no statement about its value for implementation or deployment. Documents approved for publication by the RFC Editor are not a candidate for any level of Internet Standard; see Section 2 of RFC 5741.
これは、独立して、他のRFCストリームの、RFCシリーズへの貢献です。 RFC Editorはその裁量でこの文書を公開することを選択し、実装や展開のためにその値についての声明を出すていません。 RFC編集者によって公表のために承認されたドキュメントは、インターネット標準の任意のレベルの候補ではありません。 RFC 5741のセクション2を参照してください。
Information about the current status of this document, any errata, and how to provide feedback on it may be obtained at http://www.rfc-editor.org/info/rfc5861.
このドキュメントの現在の状態、任意の正誤表、そしてどのようにフィードバックを提供するための情報がhttp://www.rfc-editor.org/info/rfc5861で取得することができます。
Copyright Notice
著作権表示
Copyright (c) 2010 IETF Trust and the persons identified as the document authors. All rights reserved.
著作権(C)2010 IETF信託とドキュメントの作成者として特定の人物。全著作権所有。
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://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.
この文書では、BCP 78と、この文書の発行日に有効なIETFドキュメント(http://trustee.ietf.org/license-info)に関連IETFトラストの法律の規定に従うものとします。彼らは、この文書に関してあなたの権利と制限を説明するように、慎重にこれらの文書を確認してください。
Table of Contents
目次
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 2 2. Notational Conventions . . . . . . . . . . . . . . . . . . . . 2 3. The stale-while-revalidate Cache-Control Extension . . . . . . 2 3.1. Example . . . . . . . . . . . . . . . . . . . . . . . . . . 3 4. The stale-if-error Cache-Control Extension . . . . . . . . . . 3 4.1. Example . . . . . . . . . . . . . . . . . . . . . . . . . . 4 5. Security Considerations . . . . . . . . . . . . . . . . . . . . 5 6. Normative References . . . . . . . . . . . . . . . . . . . . . 5 Appendix A. Acknowledgements . . . . . . . . . . . . . . . . . . . 6
HTTP [RFC2616] requires that caches "respond to a request with the most up-to-date response held... that is appropriate to the request," although "in carefully considered circumstances" a stale response is allowed to be returned. This document defines two independent Cache-Control extensions that allow for such control, stale-if-error and stale-while-revalidate.
HTTP [RFC2616]は、「慎重に検討の状況では、」古くなったレスポンスを返すことを許可するものの、キャッシュが「...それは、要求に適切である、開催された最新の応答で要求に応える」ことが必要です。この文書は、このような制御を可能にする2つの独立したのCache-Controlの拡張機能、古い-IF-エラーと古い-しばらく-再検証を定義します。
The stale-if-error HTTP Cache-Control extension allows a cache to return a stale response when an error -- e.g., a 500 Internal Server Error, a network segment, or DNS failure -- is encountered, rather than returning a "hard" error. This improves availability.
例えば、500内部サーバーエラー、ネットワークセグメント、またはDNSの障害 - - 古い-IF-エラーHTTPのCache-Controlの拡張機能は、エラーがときにキャッシュが古くなったレスポンスを返すことができます発生した、というよりも「ハードを返します「エラーが発生しました。これは、可用性が向上します。
The stale-while-revalidate HTTP Cache-Control extension allows a cache to immediately return a stale response while it revalidates it in the background, thereby hiding latency (both in the network and on the server) from clients.
陳腐-一方、再検証HTTPキャッシュ制御拡張は、それによってクライアントから(ネットワークおよびサーバーの両方の)待ち時間を隠し、それがバックグラウンドでそれを再確認しながら、キャッシュがすぐに古くなったレスポンスを返すことができます。
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 [RFC2119].
この文書のキーワード "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", および "OPTIONAL" はRFC 2119 [RFC2119]に記載されているように解釈されます。
This specification uses the augmented Backus-Naur Form of RFC 2616 [RFC2616], and it includes the delta-seconds rule from that specification.
この仕様はRFC 2616 [RFC2616]の増補BNF記法を使用し、その仕様からデルタ秒ルールが含まれています。
When present in an HTTP response, the stale-while-revalidate Cache-Control extension indicates that caches MAY serve the response in which it appears after it becomes stale, up to the indicated number of seconds.
ときにHTTPレスポンスに存在する、古い-しばらく-再検証のCache-Controlの拡張機能は、キャッシュが、それは指定された秒数まで、古くなった後、それが表示される応答を果たすことができることを示しています。
stale-while-revalidate = "stale-while-revalidate" "=" delta-seconds
古い-しばらく-再検証は=「古い-しばらく-再検証」「=」デルタ - 秒
If a cached response is served stale due to the presence of this extension, the cache SHOULD attempt to revalidate it while still serving stale responses (i.e., without blocking).
キャッシュされた応答が原因この拡張の存在に古い提供されている場合は、キャッシュはまだ(すなわち、ブロックせず)古くなったレスポンスを提供しながら、それを再検証を試みる必要があります。
Note that "stale" implies that the response will have a non-zero Age header and a warning header, as per HTTP's requirements.
「古い」は応答がHTTPの要件に従って、非ゼロの年齢ヘッダーと警告ヘッダを持っていることを意味することに注意してください。
If delta-seconds passes without the cached entity being revalidated, it SHOULD NOT continue to be served stale, absent other information.
デルタ秒は、キャッシュされたエンティティが再検証されずに通過した場合、それは古い、不在その他の情報を提供するように続けるべきではありません。
A response containing:
含む応答:
Cache-Control: max-age=600, stale-while-revalidate=30
Cache-Control:最大エージング= 600、古い-しばらく-再検証= 30
indicates that it is fresh for 600 seconds, and it may continue to be served stale for up to an additional 30 seconds while an asynchronous validation is attempted. If validation is inconclusive, or if there is not traffic that triggers it, after 30 seconds the stale-while-revalidate function will cease to operate, and the cached response will be "truly" stale (i.e., the next request will block and be handled normally).
それは600秒間新鮮であることを示し、および非同期検証が試みられている間、それは追加の30秒までのために古い提供し続けることができます。検証が決定的でない、またはそれをトリガーするトラフィックがない場合、30秒後に古い-しばらく-再検証機能が動作しなくなり、キャッシュされた応答は(すなわち、次の要求をブロックしてなり、「真の」陳腐されます)正常に処理されます。
Generally, servers will want to set the combination of max-age and stale-while-revalidate to the longest total potential freshness lifetime that they can tolerate. For example, with both set to 600, the server must be able to tolerate the response being served from cache for up to 20 minutes.
一般的に、サーバーは、最大エージングの組み合わせを設定し、それらが許容できる最長の総潜在的な新鮮寿命に古い-しばらく-再検証したいと思うでしょう。例えば、600に設定の両方で、サーバーは、最大20分間キャッシュから提供された応答を許容できなければなりません。
Since asynchronous validation will only happen if a request occurs after the response has become stale, but before the end of the stale-while-revalidate window, the size of that window and the likelihood of a request during it determines how likely it is that all requests will be served without delay. If the window is too small, or traffic is too sparse, some requests will fall outside of it, and block until the server can validate the cached response.
要求が発生した場合、レスポンスが古くなっていますが、古い-しばらく-再検証ウィンドウの終了前に、そのウィンドウの大きさと、それ中の要求の可能性が、それはすべてのことをどのように可能性を決定した後、非同期検証にのみ発生しますので、リクエストは、遅滞なく提供されます。ウィンドウが小さすぎる、またはトラフィックがあまりにも希薄である場合には、いくつかの要求はそれの外に落ちると、サーバはキャッシュされた応答を検証できるようになるまでブロックします。
The stale-if-error Cache-Control extension indicates that when an error is encountered, a cached stale response MAY be used to satisfy the request, regardless of other freshness information.
陳腐-IF-エラーキャッシュ制御拡張は、エラーが発生した場合、キャッシュされた失効応答にかかわらず、他の鮮度情報の要求を満たすために使用され得ることを示しています。
stale-if-error = "stale-if-error" "=" delta-seconds
古い-IF-エラー= "古い-IF-エラー" "=" デルタ - 秒
When used as a request Cache-Control extension, its scope of application is the request it appears in; when used as a response Cache-Control extension, its scope is any request applicable to the cached response in which it occurs.
要求のCache-Controlの拡張機能として使用する場合、アプリケーションのその範囲は、それが中に表示される要求があります。応答キャッシュ制御拡張として使用される場合、その範囲は、それが発生したキャッシュされた応答に適用任意の要求です。
Its value indicates the upper limit to staleness; when the cached response is more stale than the indicated amount, the cached response SHOULD NOT be used to satisfy the request, absent other information.
その値は陳腐化の上限を示しています。キャッシュされた応答が示された量よりも古くなっている場合、キャッシュされた応答は、要求、存在しない他の情報を満たすために使用すべきではありません。
In this context, an error is any situation that would result in a 500, 502, 503, or 504 HTTP response status code being returned.
この文脈では、エラーは500、502、503、または504 HTTPレスポンスステータスコードが返されることになる任意の状況です。
Note that this directive does not affect freshness; stale cached responses that are used SHOULD still be visibly stale when sent (i.e., have a non-zero Age header and a warning header, as per HTTP's requirements).
このディレクティブは、新鮮さには影響しないことに注意してください。送信時に使用される失効キャッシュされた応答はまだ目に見えて陳腐であるべきである(すなわち、HTTPの要求に従って、非ゼロ年齢ヘッダと警告ヘッダを持っています)。
A response containing:
含む応答:
HTTP/1.1 200 OK Cache-Control: max-age=600, stale-if-error=1200 Content-Type: text/plain
HTTP / 1.1 200 OKのCache-Control:最大エージング= 600、古い-IF-エラー= 1200のContent-Type:text / plainの
success
成功
indicates that it is fresh for 600 seconds, and that it may be used if an error is encountered after becoming stale for an additional 1200 seconds.
それは600秒間新鮮であることを示し、エラーが追加1200秒のために古くなった後に発生した場合、それが使用されてもよいです。
Thus, if the cache attempts to validate 900 seconds afterwards and encounters:
したがって、キャッシュはその後の900秒を検証しようと遭遇した場合:
HTTP/1.1 500 Internal Server Error Content-Type: text/plain
HTTP / 1.1 500内部サーバーエラーのContent-Type:text / plainの
failure
故障
the successful response can be returned instead:
正常な応答が代わりに返されます。
HTTP/1.1 200 OK Cache-Control: max-age=600, stale-if-error=1200 Age: 900 Content-Type: text/plain
HTTP / 1.1 200 OKのCache-Control:最大エージング= 600、= 1200年齢古い-IF-エラー:900のContent-Type:text / plainの
success
成功
After the age is greater than 1800 seconds (i.e., it has been stale for 1200 seconds), the cache must write the error message through.
年齢を超える1800秒(すなわち、それは1200秒間古くなってきました)された後、キャッシュはエラーメッセージをライトスルーしなければなりません。
HTTP/1.1 500 Internal Server Error Content-Type: text/plain
HTTP / 1.1 500内部サーバーエラーのContent-Type:text / plainの
failure
故障
The stale-while-revalidate extension provides origin servers with a mechanism for dictating that stale content should be served from caches under certain circumstances, with the expectation that the cached response will be revalidated in the background. It is suggested that such validation be predicated upon an incoming request, to avoid the possibility of an amplification attack (as can be seen in some other pre-fetching and automatic refresh mechanisms). Cache implementers should keep this in mind when deciding the circumstances under which they will generate a request that is not directly initiated by a user or client.
陳腐-一方、再検証拡張は、古いコンテンツはキャッシュされた応答はバックグラウンドで再検証されることを期待して、特定の状況下でのキャッシュから提供されるべきであることを口述する機構をオリジンサーバを提供します。増幅攻撃(他のいくつかのプリフェッチおよび自動リフレッシュ機構に見られるように)の可能性を回避するために、そのような検証は、着信要求に応じて予測されることが示唆されています。彼らは直接ユーザーまたはクライアントによって開始されていない要求を生成しますする状況を決定する際に、キャッシュの実装はこれを覚えておく必要があります。
The stale-if-error provides origin servers and clients a mechanism for dictating that stale content should be served from caches under certain circumstances, and does not pose additional security considerations over those of RFC 2616, which also allows stale content to be served.
古い-IF-エラーがオリジンサーバとクライアントの古いコンテンツは特定の状況下でのキャッシュから提供されなければならない、とも古いコンテンツを提供することを可能にする、RFC 2616のものよりも追加のセキュリティの考慮事項を提起しないことを決定付けるためのメカニズムを提供します。
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.
[RFC2119]ブラドナーの、S.、 "要件レベルを示すためにRFCsにおける使用のためのキーワード"、BCP 14、RFC 2119、1997年3月。
[RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999.
[RFC2616]フィールディング、R.、ゲティス、J.、モーグル、J.、Frystyk、H.、Masinter、L.、リーチ、P.、およびT.バーナーズ - リー、 "ハイパーテキスト転送プロトコル - HTTP / 1.1" 、RFC 2616、1999年6月。
Appendix A. Acknowledgements
付録A.謝辞
Thanks to Ben Drees, John Nienart, Henrik Nordstrom, Evan Torrie, and Chris Westin for their suggestions. The author takes all responsibility for errors and omissions.
彼らの提案のためのベン・ドレース、ジョンNienart、ヘンリクノードストローム、エヴァントリー、そしてクリス・ウェスティンに感謝します。著者は、エラーや脱落について一切の責任を取ります。
Author's Address
著者のアドレス
Mark Nottingham Yahoo! Inc.
マーク・ノッティンガムのYahoo!株式会社
EMail: mnot@yahoo-inc.com URI: http://www.mnot.net/
電子メール:mnot@yahoo-inc.com URI:http://www.mnot.net/