[5] If-Range:
ヘッダーは、
範囲要求を適用するべき条件を示すものです。
[4] If-Range:
ヘッダーは、
選択された表現について範囲要求を適用するべきかどうか判断する条件を指定するものです。
[7] If-Range:
ヘッダーの値は、
実体タグかHTTPの日時形式のいずれかです >>3。
[10] クライアントは、弱い実体タグを生成してはなりません >>3。
[11] クライアントは、元の表現に実体タグが含まれていなかった場合で、
日時が強い検証子だった場合を除き、 If-Range:
ヘッダーに日時を指定してはなりません >>3。
[8] クライアントは、 Range:
ヘッダーのない要求で
If-Range:
ヘッダーを生成してはなりません >>3。
[12] If-Range:
ヘッダーの事前条件の評価は、
次のように行わなければなりません >>3。
If a client has a partial copy of an entity in its cache, and wishes to have an up-to-date copy of the entire entity in its cache, it could use the Range request-header with a conditional GET (using either or both of If-Unmodified-Since and If-Match.) However, if the condition fails because the entity has been modified, the client would then have to make a second request to obtain the entire current entity-body.
クライアントがそのキャッシュに実体の部分複製を持っており、
そのキャッシュに最新の完全な実体の複製を有したいと思ったら、
Range
要求頭を
条件付GET (If-Unmodified-Since
と If-Match
の一方または両方を使用)
で使うことができます。しかし、実体が修正されていたがために条件が失敗したら、
クライアントは現在の完全な実体本体を得るために二番目の要求を行わなければなりません。
The If-Range header allows a client to "short-circuit" the second request. Informally, its meaning is `if the entity is unchanged, send me the part(s) that I am missing; otherwise, send me the entire new entity'.
'
If-Range
頭を使うと、クライアントは二番目の要求を「短絡」
できます。非公式には、この意味は「もし実体が変更されていなければ、
私が持っていない部分(群)を送ってください。そうでなければ、
新しい実体全体を送ってください。」です。
- If-Range = "If-Range" ":" ( entity-tag | HTTP-date )
If the client has no entity tag for an entity, but does have a Last-Modified date, it
mayMAY use that date in an If-Range header. (The server can distinguish between a valid HTTP-date and any form of entity-tag by examining no more than two characters.) The If-Range headershouldSHOULD only be used together with a Range header, andmustMUST be ignored if the request does not include a Range header, or if the server does not support the sub-range operation.
クライアントが実体の実体札を持っていないものの、
Last-Modified
日付は持っている場合は、
この日付を If-Range
頭で使っても構いません。
(サーバーは、妥当な HTTP-date
と任意の書式の
entity-tag
を高々2文字検査すれば区別できます。 (訳注: entity-tag
は必ず W/"
または "
で始まります。 HTTP-date
は必ず英数字で始まりますが、紛らわしいのは Wed
で始まる場合だけです。))
If-Range
頭は Range
頭と一緒でのみ使用するべきであり、要求が
Range
頭を含んでいない場合やサーバーは部分範囲操作に対応していない場合には無視しなければなりません。
If the entity tag given in the If-Range header matches the current entity tag for the entity, then the server
shouldSHOULD provide the specified sub-range of the entity using a 206 (Partial content) response. If the entity tag does not match, then the servershouldSHOULD return the entire entity using a 200 (OK) response.
If-Range
頭に与えられた実体頭がその実体の現在の実体札と一致する時は、
サーバーはその実体の指定された部分範囲を 206
(部分内容)
応答を使って提供するべきです。実体札が一致しなければ、
サーバーは 200
(了解) 応答を使って実体全体を返すべきです。
[24] Allow range header to be set by APIs by jakearchibald · Pull Request #560 · whatwg/fetch () <https://github.com/whatwg/fetch/pull/560>
[25] Allow range header to be set by APIs by jakearchibald · Pull Request #560 · whatwg/fetch () <https://github.com/whatwg/fetch/pull/560>