public final class CacheControl extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
CacheControl.Builder
构建一个
Cache-Control请求头 |
| Modifier and Type | Field and Description |
|---|---|
static CacheControl |
FORCE_CACHE
仅使用缓存的缓存控制请求指令,即使缓存的响应已过期。如果响应在缓存中不可用,
或者需要服务器验证,调用将失败
|
static CacheControl |
FORCE_NETWORK
需要对响应进行网络验证的缓存控制请求指令。请注意,缓存可以通过有条件的GET请求来辅助这些请求.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
immutable() |
boolean |
isPrivate() |
boolean |
isPublic() |
int |
maxAgeSeconds() |
int |
maxStaleSeconds() |
int |
minFreshSeconds() |
boolean |
mustRevalidate() |
boolean |
noCache() |
boolean |
noStore() |
boolean |
noTransform() |
boolean |
onlyIfCached() |
static CacheControl |
parse(Headers headers)
返回
headers的缓存指令。
如果存在Cache-Control和Pragma头文件,则会同时显示它们 |
int |
sMaxAgeSeconds() |
String |
toString() |
public static final CacheControl FORCE_NETWORK
public static final CacheControl FORCE_CACHE
public static CacheControl parse(Headers headers)
headers的缓存指令。
如果存在Cache-Control和Pragma头文件,则会同时显示它们headers - headerspublic boolean noCache()
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 © 2019. All rights reserved.