public final class CacheControl extends Object
See RFC 7234, 5.2.
| 限定符和类型 | 类和说明 |
|---|---|
static class |
CacheControl.Builder
Builds a
Cache-Control request header. |
| 限定符和类型 | 字段和说明 |
|---|---|
static CacheControl |
FORCE_CACHE
Cache control request directives that uses the cache only, even if the cached response is
stale.
|
static CacheControl |
FORCE_NETWORK
Cache control request directives that require network validation of responses.
|
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
immutable() |
boolean |
isPrivate() |
boolean |
isPublic() |
int |
maxAgeSeconds()
The duration past the response's served date that it can be served without validation.
|
int |
maxStaleSeconds() |
int |
minFreshSeconds() |
boolean |
mustRevalidate() |
boolean |
noCache()
In a response, this field's name "no-cache" is misleading.
|
boolean |
noStore()
If true, this response should not be cached.
|
boolean |
noTransform() |
boolean |
onlyIfCached()
This field's name "only-if-cached" is misleading.
|
static CacheControl |
parse(Headers headers)
Returns the cache directives of
headers. |
int |
sMaxAgeSeconds()
The "s-maxage" directive is the max age for shared caches.
|
String |
toString() |
public static final CacheControl FORCE_NETWORK
public static final CacheControl FORCE_CACHE
504 Unsatisfiable Request.public static CacheControl parse(Headers headers)
headers. This honors both Cache-Control and Pragma
headers if they are present.public boolean noCache()
In a request, it means do not use a cache to satisfy the request.
public boolean noStore()
public int maxAgeSeconds()
public int sMaxAgeSeconds()
public boolean isPrivate()
public boolean isPublic()
public boolean mustRevalidate()
public int maxStaleSeconds()
public int minFreshSeconds()
public boolean onlyIfCached()
public boolean noTransform()
public boolean immutable()
Copyright © 2024. All rights reserved.