cache-tests icon indicating copy to clipboard operation
cache-tests copied to clipboard

Storing incomplete responses

Open mnot opened this issue 5 years ago • 1 comments

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.

mnot avatar Dec 10 '18 01:12 mnot

  • [ ] cache may store incomplete 200, serve 206 from it
  • [ ] cache must not store incomplete if it doesn't support Range/Content-Range
  • [ ] cache must not use incomplete response for a complete request
  • [ ] cache must mark incomplete with 206

mnot avatar Oct 12 '20 04:10 mnot