Returns updated, filtered set of response headers to return to clients receiving the cached response.
This function is necessary, because proxies MUST always remove hop-by-hop headers (such as TE and Connection) and
update response's Age to avoid doubling cache time.
Example:
cachedResponse.headers = cachePolicy.responseHeaders(cachedResponse);
Use this method to update the cache after receiving a new response from the origin server.
Returns updated, filtered set of request headers to send to the origin server to check if the cached response can be reused. These headers allow the origin server to return status 304 indicating the response is still fresh. All headers unrelated to caching are passed through as-is.
Use this method when updating cache from the origin server.
This is the most important method. Use this method to check whether a cached response is still fresh in the context of the new request.
If it returns true, then the given request matches the original response this cache policy has been created with, and the response can be reused without contacting the server. Note that the old response can't be returned without being updated, see responseHeaders().
If it returns false, then the response may not be matching at all (e.g. it's for a different URL or method), or may require to be refreshed first (see revalidationHeaders()).
Returns true if the response can be stored in a cache. If it's false then you MUST NOT store either the request or the response.
Returns approximate time in milliseconds until the response becomes stale (i.e. not fresh).
After that time (when timeToLive() <= 0) the response might not be usable without revalidation. However,
there are exceptions, e.g. a client can explicitly allow stale responses, so always check with
satisfiesWithoutRevalidation().
A wrapper around an HTTP request cache policy that exposes it as a dereference cache policy.