Passa al contenuto principale

3. Storing Responses in Caches (在缓存中存储响应)

🇬🇧 English

A cache MUST NOT store a response to any request, unless:

  • The request method is understood by the cache and defined as being cacheable, and
  • the response status code is understood by the cache, and
  • the "no-store" cache directive (see Section 5.2) does not appear in request or response header fields, and
  • the "private" response directive (see Section 5.2.2.6) does not appear in the response, if the cache is shared, and
  • the Authorization header field (see Section 4.2 of [RFC7235]) does not appear in the request, if the cache is shared, unless the response explicitly allows it (see Section 3.2), and
  • the response either:
    • contains an Expires header field (see Section 5.3), or
    • contains a max-age response directive (see Section 5.2.2.8), or
    • contains a s-maxage response directive (see Section 5.2.2.9) and the cache is shared, or
    • contains a Cache Control Extension (see Section 5.2.3) that allows it to be cached, or
    • has a status code that is defined as cacheable by default (see Section 4.2.2), or
    • contains a public response directive (see Section 5.2.2.5).

Note that any of the requirements listed above can be overridden by a cache-control extension; see Section 5.2.3.

In this context, a cache has "understood" a request method or a response status code if it recognizes it and implements all specified caching-related behavior.

Note that, in normal operation, some caches will not store a response that has neither a cache validator nor an explicit expiration time, as such responses are not usually useful to store. However, caches are not prohibited from storing such responses.


🇨🇳 中文

缓存不得 (MUST NOT) 存储对任何请求的响应,除非:

  • 缓存理解请求方法并且该方法被定义为可缓存的,并且
  • 缓存理解响应状态码,并且
  • "no-store"缓存指令(见第5.2节)未出现在请求或响应头字段中,并且
  • "private"响应指令(见第5.2.2.6节)未出现在响应中(如果缓存是共享的),并且
  • Authorization头字段(见 [RFC7235] 的第4.2节)未出现在请求中(如果缓存是共享的),除非响应明确允许(见第3.2节),并且
  • 响应满足以下任一条件:
    • 包含Expires头字段(见第5.3节),或
    • 包含max-age响应指令(见第5.2.2.8节),或
    • 包含s-maxage响应指令(见第5.2.2.9节)并且缓存是共享的,或
    • 包含允许缓存的Cache Control扩展(见第5.2.3节),或
    • 具有默认定义为可缓存的状态码(见第4.2.2节),或
    • 包含public响应指令(见第5.2.2.5节)。

请注意,上述任何要求都可以被缓存控制扩展覆盖; 见第5.2.3节。

在此上下文中,如果缓存识别请求方法或响应状态码并实现所有指定的缓存相关行为,则缓存已"理解"该方法或状态码。

请注意,在正常操作中,一些缓存不会存储既没有缓存验证器也没有显式过期时间的响应,因为此类响应通常不值得存储。但是,缓存并未被禁止存储此类响应。


🇯🇵 日本語

キャッシュは、次の条件を満たさない限り、いかなるリクエストへのレスポンスも保存してはならない (MUST NOT):

  • リクエストメソッドがキャッシュによって理解され、キャッシュ可能として定義されており、かつ
  • レスポンスステータスコードがキャッシュによって理解されており、かつ
  • "no-store"キャッシュディレクティブ(セクション5.2参照)がリクエストまたはレスポンスヘッダーフィールドに現れておらず、かつ
  • "private"レスポンスディレクティブ(セクション5.2.2.6参照)がレスポンスに現れていない(キャッシュが共有されている場合)、かつ
  • Authorizationヘッダーフィールド([RFC7235] のセクション4.2参照)がリクエストに現れていない(キャッシュが共有されている場合)、ただしレスポンスが明示的に許可している場合を除く(セクション3.2参照)、かつ
  • レスポンスが次のいずれかを満たす:
    • Expiresヘッダーフィールドを含む(セクション5.3参照)、または
    • max-ageレスポンスディレクティブを含む(セクション5.2.2.8参照)、または
    • s-maxageレスポンスディレクティブを含み、キャッシュが共有されている(セクション5.2.2.9参照)、または
    • キャッシュを許可するCache Control拡張を含む(セクション5.2.3参照)、または
    • デフォルトでキャッシュ可能として定義されているステータスコードを持つ(セクション4.2.2参照)、または
    • publicレスポンスディレクティブを含む(セクション5.2.2.5参照)。

上記の要件のいずれも、キャッシュ制御拡張によって上書きできることに注意すること; セクション5.2.3を参照。

この文脈では、キャッシュがリクエストメソッドまたはレスポンスステータスコードを「理解した」とは、それを認識し、指定されたすべてのキャッシュ関連の動作を実装している場合を指す。

通常の操作では、一部のキャッシュは、キャッシュバリデータも明示的な有効期限も持たないレスポンスを保存しないことに注意すること。このようなレスポンスは通常、保存する価値がないためである。ただし、キャッシュがそのようなレスポンスを保存することは禁止されていない。


🇫🇷 Français

Un cache NE DOIT PAS (MUST NOT) stocker une réponse à une requête, sauf si :

  • La méthode de requête est comprise par le cache et définie comme pouvant être mise en cache, et
  • le code d'état de la réponse est compris par le cache, et
  • la directive de cache "no-store" (voir Section 5.2) n'apparaît pas dans les champs d'en-tête de la requête ou de la réponse, et
  • la directive de réponse "private" (voir Section 5.2.2.6) n'apparaît pas dans la réponse, si le cache est partagé, et
  • le champ d'en-tête Authorization (voir Section 4.2 de [RFC7235]) n'apparaît pas dans la requête, si le cache est partagé, sauf si la réponse l'autorise explicitement (voir Section 3.2), et
  • la réponse satisfait l'une des conditions suivantes :
    • contient un champ d'en-tête Expires (voir Section 5.3), ou
    • contient une directive de réponse max-age (voir Section 5.2.2.8), ou
    • contient une directive de réponse s-maxage (voir Section 5.2.2.9) et le cache est partagé, ou
    • contient une Extension Cache Control (voir Section 5.2.3) qui autorise sa mise en cache, ou
    • a un code d'état défini comme pouvant être mis en cache par défaut (voir Section 4.2.2), ou
    • contient une directive de réponse public (voir Section 5.2.2.5).

Notez que l'une quelconque des exigences énumérées ci-dessus peut être remplacée par une extension de contrôle de cache ; voir Section 5.2.3.

Dans ce contexte, un cache a « compris » une méthode de requête ou un code d'état de réponse s'il le reconnaît et implémente tout le comportement lié à la mise en cache spécifié.

Notez qu'en fonctionnement normal, certains caches ne stockeront pas une réponse qui n'a ni validateur de cache ni temps d'expiration explicite, car de telles réponses ne sont généralement pas utiles à stocker. Cependant, les caches ne sont pas interdits de stocker de telles réponses.


🇩🇪 Deutsch

Ein Cache DARF NICHT (MUST NOT) eine Antwort auf eine Anfrage speichern, es sei denn:

  • Die Anfragemethode wird vom Cache verstanden und ist als cachefähig definiert, und
  • der Antwortstatuscode wird vom Cache verstanden, und
  • die "no-store"-Cache-Direktive (siehe Abschnitt 5.2) erscheint nicht in den Anfrage- oder Antwort-Header-Feldern, und
  • die "private"-Antwortdirektive (siehe Abschnitt 5.2.2.6) erscheint nicht in der Antwort, wenn der Cache gemeinsam genutzt wird, und
  • das Authorization-Header-Feld (siehe Abschnitt 4.2 von [RFC7235]) erscheint nicht in der Anfrage, wenn der Cache gemeinsam genutzt wird, es sei denn, die Antwort erlaubt dies ausdrücklich (siehe Abschnitt 3.2), und
  • die Antwort erfüllt eine der folgenden Bedingungen:
    • enthält ein Expires-Header-Feld (siehe Abschnitt 5.3), oder
    • enthält eine max-age-Antwortdirektive (siehe Abschnitt 5.2.2.8), oder
    • enthält eine s-maxage-Antwortdirektive (siehe Abschnitt 5.2.2.9) und der Cache wird gemeinsam genutzt, oder
    • enthält eine Cache-Control-Erweiterung (siehe Abschnitt 5.2.3), die das Caching erlaubt, oder
    • hat einen Statuscode, der standardmäßig als cachefähig definiert ist (siehe Abschnitt 4.2.2), oder
    • enthält eine public-Antwortdirektive (siehe Abschnitt 5.2.2.5).

Beachten Sie, dass jede der oben aufgeführten Anforderungen durch eine Cache-Control-Erweiterung überschrieben werden kann; siehe Abschnitt 5.2.3.

In diesem Kontext hat ein Cache eine Anfragemethode oder einen Antwortstatuscode „verstanden", wenn er ihn erkennt und alle spezifizierten cachebezogenen Verhaltensweisen implementiert.

Beachten Sie, dass im normalen Betrieb einige Caches keine Antwort speichern werden, die weder einen Cache-Validator noch eine explizite Ablaufzeit hat, da solche Antworten normalerweise nicht nützlich zu speichern sind. Caches sind jedoch nicht daran gehindert, solche Antworten zu speichern.


🇮🇹 Italiano

Una cache NON DEVE (MUST NOT) memorizzare una risposta a qualsiasi richiesta, a meno che:

  • Il metodo di richiesta sia compreso dalla cache e definito come memorizzabile in cache, e
  • il codice di stato della risposta sia compreso dalla cache, e
  • la direttiva di cache "no-store" (vedere Sezione 5.2) non appaia nei campi di intestazione della richiesta o della risposta, e
  • la direttiva di risposta "private" (vedere Sezione 5.2.2.6) non appaia nella risposta, se la cache è condivisa, e
  • il campo di intestazione Authorization (vedere Sezione 4.2 di [RFC7235]) non appaia nella richiesta, se la cache è condivisa, a meno che la risposta lo consenta esplicitamente (vedere Sezione 3.2), e
  • la risposta soddisfi una delle seguenti condizioni:
    • contiene un campo di intestazione Expires (vedere Sezione 5.3), o
    • contiene una direttiva di risposta max-age (vedere Sezione 5.2.2.8), o
    • contiene una direttiva di risposta s-maxage (vedere Sezione 5.2.2.9) e la cache è condivisa, o
    • contiene un'Estensione Cache Control (vedere Sezione 5.2.3) che consente di memorizzarla in cache, o
    • ha un codice di stato definito come memorizzabile in cache per impostazione predefinita (vedere Sezione 4.2.2), o
    • contiene una direttiva di risposta public (vedere Sezione 5.2.2.5).

Si noti che uno qualsiasi dei requisiti elencati sopra può essere sostituito da un'estensione di controllo della cache; vedere Sezione 5.2.3.

In questo contesto, una cache ha "compreso" un metodo di richiesta o un codice di stato di risposta se lo riconosce e implementa tutto il comportamento relativo al caching specificato.

Si noti che, durante il funzionamento normale, alcune cache non memorizzeranno una risposta che non ha né un validatore di cache né un tempo di scadenza esplicito, poiché tali risposte di solito non sono utili da memorizzare. Tuttavia, le cache non sono vietate dal memorizzare tali risposte.


3.1. Storing Incomplete Responses (存储不完整的响应)

🇬🇧 English

A response message is considered complete when all of the octets indicated by the message framing ([RFC7230]) are received prior to the connection being closed. If the request method is GET, the response status code is 200 (OK), and the entire response header section has been received, a cache MAY store an incomplete response message body if the cache entry is recorded as incomplete. Likewise, a 206 (Partial Content) response MAY be stored as if it were an incomplete 200 (OK) cache entry. However, a cache MUST NOT store incomplete or partial-content responses if it does not support the Range and Content-Range header fields or if it does not understand the range units used in those fields.

A cache MAY complete a stored incomplete response by making a subsequent range request ([RFC7233]) and combining the successful response with the stored entry, as defined in Section 3.3. A cache MUST NOT use an incomplete response to answer requests unless the response has been made complete or the request is partial and specifies a range that is wholly within the incomplete response. A cache MUST NOT send a partial response to a client without explicitly marking it as such using the 206 (Partial Content) status code.


🇨🇳 中文

当消息框架([RFC7230])指示的所有字节在连接关闭之前被接收时,响应消息被认为是完整的。如果请求方法是GET,响应状态码是200 (OK),并且已接收到整个响应头部分,则缓存可以 (MAY) 存储不完整的响应消息主体,前提是缓存条目被记录为不完整。同样,206 (Partial Content) 响应可以 (MAY) 作为不完整的200 (OK) 缓存条目存储。但是,如果缓存不支持Range和Content-Range头字段,或者不理解这些字段中使用的范围单位,则缓存不得 (MUST NOT) 存储不完整或部分内容的响应。

缓存可以 (MAY) 通过发出后续范围请求([RFC7233])并将成功的响应与存储的条目组合来完成存储的不完整响应,如第3.3节所定义。除非响应已完成或请求是部分的并且指定的范围完全在不完整响应内,否则缓存不得 (MUST NOT) 使用不完整的响应来回答请求。缓存不得 (MUST NOT) 向客户端发送部分响应而不使用206 (Partial Content) 状态码明确标记。


🇯🇵 日本語

メッセージフレーミング([RFC7230])によって示されるすべてのオクテットが接続が閉じられる前に受信された場合、レスポンスメッセージは完全であると見なされる。リクエストメソッドがGETで、レスポンスステータスコードが200 (OK) であり、レスポンスヘッダーセクション全体が受信されている場合、キャッシュエントリが不完全として記録されていれば、キャッシュは不完全なレスポンスメッセージボディを保存してもよい (MAY)。同様に、206 (Partial Content) レスポンスは、不完全な200 (OK) キャッシュエントリであるかのように保存してもよい (MAY)。ただし、キャッシュがRangeおよびContent-Rangeヘッダーフィールドをサポートしていない場合、またはそれらのフィールドで使用されている範囲単位を理解していない場合、キャッシュは不完全または部分的なコンテンツのレスポンスを保存してはならない (MUST NOT)。

キャッシュは、セクション3.3で定義されているように、後続の範囲リクエスト([RFC7233])を行い、成功したレスポンスを保存されたエントリと組み合わせることによって、保存された不完全なレスポンスを完成させてもよい (MAY)。レスポンスが完成されていない限り、またはリクエストが部分的であり、指定された範囲が不完全なレスポンス内に完全に含まれていない限り、キャッシュは不完全なレスポンスを使用してリクエストに応答してはならない (MUST NOT)。キャッシュは、206 (Partial Content) ステータスコードを使用して明示的にマークすることなく、部分的なレスポンスをクライアントに送信してはならない (MUST NOT)。


🇫🇷 Français

Un message de réponse est considéré comme complet lorsque tous les octets indiqués par le cadrage du message ([RFC7230]) sont reçus avant que la connexion ne soit fermée. Si la méthode de requête est GET, le code d'état de la réponse est 200 (OK) et que la section d'en-tête de réponse entière a été reçue, un cache PEUT (MAY) stocker un corps de message de réponse incomplet si l'entrée de cache est enregistrée comme incomplète. De même, une réponse 206 (Partial Content) PEUT (MAY) être stockée comme s'il s'agissait d'une entrée de cache 200 (OK) incomplète. Cependant, un cache NE DOIT PAS (MUST NOT) stocker de réponses incomplètes ou de contenu partiel s'il ne prend pas en charge les champs d'en-tête Range et Content-Range ou s'il ne comprend pas les unités de plage utilisées dans ces champs.

Un cache PEUT (MAY) compléter une réponse incomplète stockée en effectuant une requête de plage ultérieure ([RFC7233]) et en combinant la réponse réussie avec l'entrée stockée, comme défini dans la Section 3.3. Un cache NE DOIT PAS (MUST NOT) utiliser une réponse incomplète pour répondre aux requêtes à moins que la réponse n'ait été complétée ou que la requête ne soit partielle et spécifie une plage entièrement contenue dans la réponse incomplète. Un cache NE DOIT PAS (MUST NOT) envoyer une réponse partielle à un client sans la marquer explicitement comme telle en utilisant le code d'état 206 (Partial Content).


🇩🇪 Deutsch

Eine Antwortnachricht gilt als vollständig, wenn alle durch die Nachrichtenrahmung ([RFC7230]) angegebenen Oktette empfangen werden, bevor die Verbindung geschlossen wird. Wenn die Anfragemethode GET ist, der Antwortstatuscode 200 (OK) ist und der gesamte Antwort-Header-Abschnitt empfangen wurde, DARF (MAY) ein Cache einen unvollständigen Antwortnachrichtentext speichern, wenn der Cache-Eintrag als unvollständig aufgezeichnet wird. Ebenso DARF (MAY) eine 206 (Partial Content) Antwort gespeichert werden, als wäre sie ein unvollständiger 200 (OK) Cache-Eintrag. Ein Cache DARF JEDOCH NICHT (MUST NOT) unvollständige oder Teilinhalts-Antworten speichern, wenn er die Range- und Content-Range-Header-Felder nicht unterstützt oder die in diesen Feldern verwendeten Bereichseinheiten nicht versteht.

Ein Cache DARF (MAY) eine gespeicherte unvollständige Antwort vervollständigen, indem er eine nachfolgende Bereichsanfrage ([RFC7233]) stellt und die erfolgreiche Antwort mit dem gespeicherten Eintrag kombiniert, wie in Abschnitt 3.3 definiert. Ein Cache DARF NICHT (MUST NOT) eine unvollständige Antwort verwenden, um Anfragen zu beantworten, es sei denn, die Antwort wurde vervollständigt oder die Anfrage ist teilweise und gibt einen Bereich an, der vollständig innerhalb der unvollständigen Antwort liegt. Ein Cache DARF NICHT (MUST NOT) eine Teilantwort an einen Client senden, ohne sie explizit als solche mit dem Statuscode 206 (Partial Content) zu kennzeichnen.


🇮🇹 Italiano

Un messaggio di risposta è considerato completo quando tutti gli ottetti indicati dall'inquadramento del messaggio ([RFC7230]) vengono ricevuti prima che la connessione venga chiusa. Se il metodo di richiesta è GET, il codice di stato della risposta è 200 (OK) e l'intera sezione di intestazione della risposta è stata ricevuta, una cache PUÒ (MAY) memorizzare un corpo di messaggio di risposta incompleto se la voce della cache è registrata come incompleta. Allo stesso modo, una risposta 206 (Partial Content) PUÒ (MAY) essere memorizzata come se fosse una voce di cache 200 (OK) incompleta. Tuttavia, una cache NON DEVE (MUST NOT) memorizzare risposte incomplete o di contenuto parziale se non supporta i campi di intestazione Range e Content-Range o se non comprende le unità di intervallo utilizzate in tali campi.

Una cache PUÒ (MAY) completare una risposta incompleta memorizzata effettuando una successiva richiesta di intervallo ([RFC7233]) e combinando la risposta riuscita con la voce memorizzata, come definito nella Sezione 3.3. Una cache NON DEVE (MUST NOT) utilizzare una risposta incompleta per rispondere alle richieste a meno che la risposta non sia stata completata o la richiesta sia parziale e specifichi un intervallo interamente contenuto nella risposta incompleta. Una cache NON DEVE (MUST NOT) inviare una risposta parziale a un client senza contrassegnarla esplicitamente come tale utilizzando il codice di stato 206 (Partial Content).


3.2. Storing Responses to Authenticated Requests (存储已认证请求的响应)

🇬🇧 English

A shared cache MUST NOT use a cached response to a request with an Authorization header field (Section 4.2 of [RFC7235]) to satisfy any subsequent request unless a cache directive that allows such responses to be stored is present in the response.

In this specification, the following Cache-Control response directives (Section 5.2.2) have such an effect: must-revalidate, public, and s-maxage.

Note that cached responses that contain the "must-revalidate" and/or "s-maxage" response directives are not allowed to be served stale (Section 4.2.4) by shared caches. In particular, a response with either "max-age=0, must-revalidate" or "s-maxage=0" cannot be used to satisfy a subsequent request without revalidating it on the origin server.


🇨🇳 中文

共享缓存不得 (MUST NOT) 使用对带有Authorization头字段([RFC7235] 的第4.2节)的请求的缓存响应来满足任何后续请求,除非响应中存在允许存储此类响应的缓存指令。

在本规范中,以下Cache-Control响应指令(第5.2.2节)具有这种效果: must-revalidate、public和s-maxage。

请注意,包含"must-revalidate"和/或"s-maxage"响应指令的缓存响应不允许被共享缓存提供过期服务(第4.2.4节)。特别是,具有"max-age=0, must-revalidate"或"s-maxage=0"的响应不能用于满足后续请求,除非在源服务器上重新验证。


🇯🇵 日本語

共有キャッシュは、Authorizationヘッダーフィールド([RFC7235] のセクション4.2)を含むリクエストに対するキャッシュされたレスポンスを使用して後続のリクエストを満たしてはならない (MUST NOT)。ただし、そのようなレスポンスの保存を許可するキャッシュディレクティブがレスポンスに存在する場合を除く。

この仕様では、以下のCache-Controlレスポンスディレクティブ(セクション5.2.2)がそのような効果を持つ: must-revalidate、public、およびs-maxage。

"must-revalidate"および/または"s-maxage"レスポンスディレクティブを含むキャッシュされたレスポンスは、共有キャッシュによって古い状態で提供されることが許可されていない(セクション4.2.4)ことに注意すること。特に、"max-age=0, must-revalidate"または"s-maxage=0"のいずれかを持つレスポンスは、オリジンサーバーで再検証することなく後続のリクエストを満たすために使用することはできない。


🇫🇷 Français

Un cache partagé NE DOIT PAS (MUST NOT) utiliser une réponse mise en cache à une requête avec un champ d'en-tête Authorization (Section 4.2 de [RFC7235]) pour satisfaire une requête ultérieure, sauf si une directive de cache autorisant le stockage de telles réponses est présente dans la réponse.

Dans cette spécification, les directives de réponse Cache-Control suivantes (Section 5.2.2) ont un tel effet : must-revalidate, public et s-maxage.

Notez que les réponses mises en cache contenant les directives de réponse "must-revalidate" et/ou "s-maxage" ne sont pas autorisées à être servies périmées (Section 4.2.4) par les caches partagés. En particulier, une réponse avec soit "max-age=0, must-revalidate" soit "s-maxage=0" ne peut pas être utilisée pour satisfaire une requête ultérieure sans la revalider sur le serveur d'origine.


🇩🇪 Deutsch

Ein gemeinsam genutzter Cache DARF NICHT (MUST NOT) eine gecachte Antwort auf eine Anfrage mit einem Authorization-Header-Feld (Abschnitt 4.2 von [RFC7235]) verwenden, um eine nachfolgende Anfrage zu erfüllen, es sei denn, eine Cache-Direktive, die das Speichern solcher Antworten erlaubt, ist in der Antwort vorhanden.

In dieser Spezifikation haben die folgenden Cache-Control-Antwortdirektiven (Abschnitt 5.2.2) eine solche Wirkung: must-revalidate, public und s-maxage.

Beachten Sie, dass gecachte Antworten, die die Antwortdirektiven "must-revalidate" und/oder "s-maxage" enthalten, nicht von gemeinsam genutzten Caches als veraltet bereitgestellt werden dürfen (Abschnitt 4.2.4). Insbesondere kann eine Antwort mit entweder "max-age=0, must-revalidate" oder "s-maxage=0" nicht verwendet werden, um eine nachfolgende Anfrage zu erfüllen, ohne sie auf dem Ursprungsserver erneut zu validieren.


🇮🇹 Italiano

Una cache condivisa NON DEVE (MUST NOT) utilizzare una risposta memorizzata in cache a una richiesta con un campo di intestazione Authorization (Sezione 4.2 di [RFC7235]) per soddisfare qualsiasi richiesta successiva, a meno che non sia presente nella risposta una direttiva di cache che consenta di memorizzare tali risposte.

In questa specifica, le seguenti direttive di risposta Cache-Control (Sezione 5.2.2) hanno tale effetto: must-revalidate, public e s-maxage.

Si noti che le risposte memorizzate in cache che contengono le direttive di risposta "must-revalidate" e/o "s-maxage" non sono autorizzate a essere servite obsolete (Sezione 4.2.4) dalle cache condivise. In particolare, una risposta con "max-age=0, must-revalidate" o "s-maxage=0" non può essere utilizzata per soddisfare una richiesta successiva senza rivalidarla sul server di origine.


3.3. Combining Partial Content (合并部分内容)

🇬🇧 English

A response might transfer only a partial representation if the connection closed prematurely or if the request used one or more Range specifiers ([RFC7233]). After several such transfers, a cache might have received several ranges of the same representation. A cache MAY combine these ranges into a single stored response, and reuse that response to satisfy later requests, if they all share the same strong validator and the cache complies with the client requirements in Section 4.3 of [RFC7233].

When combining the new response with one or more stored responses, a cache MUST:

  • delete any Warning header fields in the stored response with warn-code 1xx (see Section 5.5);
  • retain any Warning header fields in the stored response with warn-code 2xx; and,
  • use other header fields provided in the new response, aside from Content-Range, to replace all instances of the corresponding header fields in the stored response.

🇨🇳 中文

如果连接过早关闭或请求使用了一个或多个Range指定符([RFC7233]),响应可能只传输部分表示。经过几次这样的传输后,缓存可能已接收到同一表示的几个范围。如果它们都共享相同的强验证器并且缓存符合 [RFC7233] 第4.3节中的客户端要求,则缓存可以 (MAY) 将这些范围组合成单个存储的响应,并重用该响应来满足后续请求。

当将新响应与一个或多个存储的响应组合时,缓存必须 (MUST):

  • 删除存储响应中warn-code为1xx的任何Warning头字段(见第5.5节);
  • 保留存储响应中warn-code为2xx的任何Warning头字段; 以及
  • 使用新响应中提供的其他头字段(Content-Range除外)来替换存储响应中相应头字段的所有实例。

🇯🇵 日本語

接続が早期に閉じられた場合、またはリクエストが1つ以上のRange指定子([RFC7233])を使用した場合、レスポンスは部分的な表現のみを転送する可能性がある。このような転送を数回行った後、キャッシュは同じ表現の複数の範囲を受信した可能性がある。それらすべてが同じ強力なバリデータを共有し、キャッシュが [RFC7233] のセクション4.3のクライアント要件に準拠している場合、キャッシュはこれらの範囲を単一の保存されたレスポンスに結合し、そのレスポンスを後のリクエストを満たすために再利用してもよい (MAY)。

新しいレスポンスを1つ以上の保存されたレスポンスと結合する場合、キャッシュは次のことをしなければならない (MUST):

  • 保存されたレスポンス内のwarn-codeが1xxのWarningヘッダーフィールドを削除する(セクション5.5参照);
  • 保存されたレスポンス内のwarn-codeが2xxのWarningヘッダーフィールドを保持する; および
  • Content-Rangeを除き、新しいレスポンスで提供された他のヘッダーフィールドを使用して、保存されたレスポンス内の対応するヘッダーフィールドのすべてのインスタンスを置き換える。

🇫🇷 Français

Une réponse peut transférer uniquement une représentation partielle si la connexion s'est fermée prématurément ou si la requête a utilisé un ou plusieurs spécificateurs Range ([RFC7233]). Après plusieurs de ces transferts, un cache peut avoir reçu plusieurs plages de la même représentation. Un cache PEUT (MAY) combiner ces plages en une seule réponse stockée et réutiliser cette réponse pour satisfaire des requêtes ultérieures, si elles partagent toutes le même validateur fort et si le cache respecte les exigences du client dans la Section 4.3 de [RFC7233].

Lors de la combinaison de la nouvelle réponse avec une ou plusieurs réponses stockées, un cache DOIT (MUST) :

  • supprimer tous les champs d'en-tête Warning dans la réponse stockée avec un warn-code 1xx (voir Section 5.5) ;
  • conserver tous les champs d'en-tête Warning dans la réponse stockée avec un warn-code 2xx ; et
  • utiliser d'autres champs d'en-tête fournis dans la nouvelle réponse, à l'exception de Content-Range, pour remplacer toutes les instances des champs d'en-tête correspondants dans la réponse stockée.

🇩🇪 Deutsch

Eine Antwort kann nur eine partielle Darstellung übertragen, wenn die Verbindung vorzeitig geschlossen wurde oder wenn die Anfrage einen oder mehrere Range-Spezifizierer ([RFC7233]) verwendet hat. Nach mehreren solchen Übertragungen hat ein Cache möglicherweise mehrere Bereiche derselben Darstellung erhalten. Ein Cache DARF (MAY) diese Bereiche zu einer einzigen gespeicherten Antwort kombinieren und diese Antwort wiederverwenden, um spätere Anfragen zu erfüllen, wenn sie alle denselben starken Validator teilen und der Cache den Kundenanforderungen in Abschnitt 4.3 von [RFC7233] entspricht.

Beim Kombinieren der neuen Antwort mit einer oder mehreren gespeicherten Antworten MUSS (MUST) ein Cache:

  • alle Warning-Header-Felder in der gespeicherten Antwort mit warn-code 1xx löschen (siehe Abschnitt 5.5);
  • alle Warning-Header-Felder in der gespeicherten Antwort mit warn-code 2xx beibehalten; und
  • andere in der neuen Antwort bereitgestellte Header-Felder, mit Ausnahme von Content-Range, verwenden, um alle Instanzen der entsprechenden Header-Felder in der gespeicherten Antwort zu ersetzen.

🇮🇹 Italiano

Una risposta potrebbe trasferire solo una rappresentazione parziale se la connessione si chiude prematuramente o se la richiesta ha utilizzato uno o più specificatori Range ([RFC7233]). Dopo diversi trasferimenti di questo tipo, una cache potrebbe aver ricevuto diversi intervalli della stessa rappresentazione. Una cache PUÒ (MAY) combinare questi intervalli in un'unica risposta memorizzata e riutilizzare quella risposta per soddisfare richieste successive, se condividono tutti lo stesso validatore forte e la cache rispetta i requisiti del client nella Sezione 4.3 di [RFC7233].

Quando si combina la nuova risposta con una o più risposte memorizzate, una cache DEVE (MUST):

  • eliminare qualsiasi campo di intestazione Warning nella risposta memorizzata con warn-code 1xx (vedere Sezione 5.5);
  • mantenere qualsiasi campo di intestazione Warning nella risposta memorizzata con warn-code 2xx; e
  • utilizzare altri campi di intestazione forniti nella nuova risposta, ad eccezione di Content-Range, per sostituire tutte le istanze dei campi di intestazione corrispondenti nella risposta memorizzata.