类 CacheControl.Builder
java.lang.Object
com.lark.oapi.okhttp.CacheControl.Builder
- 封闭类:
CacheControl
Builds a
Cache-Control request header.-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明build()Sets the maximum age of a cached response.Accept cached responses that have exceeded their freshness lifetime by up tomaxStale.Sets the minimum number of seconds that a response will continue to be fresh for.noCache()Don't accept an unvalidated cached response.noStore()Don't store the server's response in any cache.Don't accept a transformed response.Only accept the response if it is in the cache.
-
构造器详细资料
-
Builder
public Builder()
-
-
方法详细资料
-
noCache
Don't accept an unvalidated cached response. -
noStore
Don't store the server's response in any cache. -
maxAge
Sets the maximum age of a cached response. If the cache response's age exceedsmaxAge, it will not be used and a network request will be made.- 参数:
maxAge- a non-negative integer. This is stored and transmitted withTimeUnit.SECONDSprecision; finer precision will be lost.
-
maxStale
Accept cached responses that have exceeded their freshness lifetime by up tomaxStale. If unspecified, stale cache responses will not be used.- 参数:
maxStale- a non-negative integer. This is stored and transmitted withTimeUnit.SECONDSprecision; finer precision will be lost.
-
minFresh
Sets the minimum number of seconds that a response will continue to be fresh for. If the response will be stale whenminFreshhave elapsed, the cached response will not be used and a network request will be made.- 参数:
minFresh- a non-negative integer. This is stored and transmitted withTimeUnit.SECONDSprecision; finer precision will be lost.
-
onlyIfCached
Only accept the response if it is in the cache. If the response isn't cached, a504 Unsatisfiable Requestresponse will be returned. -
noTransform
Don't accept a transformed response. -
immutable
-
build
-