from
Creates a ResponseCache from response if it is eligible for caching.
The response body is consumed (buffered) by this call. If you also need the body for other purposes, buffer it first and use the from overload that accepts a pre-buffered ByteString.
Return
The ResponseCache; null if the response is not eligible for caching.
Parameters
The HTTP response whose body will be consumed and cached.
Creates a ResponseCache from response using a pre-buffered body if the response is eligible for caching.
Use this overload when the body has already been read and must remain available for other consumers after this call returns.
Return
The ResponseCache; null if the response is not eligible for caching.
Parameters
The HTTP response whose headers and status code determine eligibility.
The already-buffered response body bytes.
The media type of the body, used when reconstructing the ResponseBody.