In a response, this field's name "no-cache" is misleading. It doesn't
prevent us from caching the response; it only means we have to validate the
response with the origin server before returning it. We can do this with a
In a request, it means do not use a cache to satisfy the request.
public boolean noStore()
If true, this response should not be cached.
public int maxAgeSeconds()
The duration past the response's served date that it can be served without
public int sMaxAgeSeconds()
The "s-maxage" directive is the max age for shared caches. Not to be
confused with "max-age" for non-shared caches, As in Firefox and Chrome,
this directive is not honored by this cache.
public boolean isPublic()
public boolean mustRevalidate()
public int maxStaleSeconds()
public int minFreshSeconds()
public boolean onlyIfCached()
This field's name "only-if-cached" is misleading. It actually means "do
not use the network". It is set by a client who only wants to make a
request if it can be fully satisfied by the cache. Cached responses that
would require validation (ie. conditional gets) are not permitted if this
header is set.
public static CacheControl parse(com.squareup.okhttp.internal.http.Headers headers)
Returns the cache directives of headers. This honors both
Cache-Control and Pragma headers if they are present.