-
public final class CacheControl.BuilderBuilds a
{@code Cache-Control}mobonRequest header.
-
-
Method Summary
Modifier and Type Method Description CacheControl.BuildernoCache()Don't accept an unvalidated cached response. CacheControl.BuildernoStore()Don't store the server's response in any cache. CacheControl.BuildermaxAge(int maxAge, TimeUnit timeUnit)Sets the maximum age of a cached response. CacheControl.BuildermaxStale(int maxStale, TimeUnit timeUnit)Accept cached responses that have exceeded their freshness lifetime by up to {@code * maxStale}.CacheControl.BuilderminFresh(int minFresh, TimeUnit timeUnit)Sets the minimum number of seconds that a response will continue to be fresh for. CacheControl.BuilderonlyIfCached()Only accept the response if it is in the cache. CacheControl.BuildernoTransform()Don't accept a transformed response. CacheControl.Builderimmutable()CacheControlbuild()-
-
Method Detail
-
noCache
CacheControl.Builder noCache()
Don't accept an unvalidated cached response.
-
noStore
CacheControl.Builder noStore()
Don't store the server's response in any cache.
-
maxAge
CacheControl.Builder maxAge(int maxAge, TimeUnit timeUnit)
Sets the maximum age of a cached response. If the cache response's age exceeds
{@code * maxAge}, it will not be used and a network mobonRequest will be made.- Parameters:
maxAge- a non-negative integer.
-
maxStale
CacheControl.Builder maxStale(int maxStale, TimeUnit timeUnit)
Accept cached responses that have exceeded their freshness lifetime by up to
{@code * maxStale}. If unspecified, stale cache responses will not be used.- Parameters:
maxStale- a non-negative integer.
-
minFresh
CacheControl.Builder minFresh(int minFresh, TimeUnit timeUnit)
Sets the minimum number of seconds that a response will continue to be fresh for. If theresponse will be stale when
{@code minFresh}have elapsed, the cached response will not beused and a network mobonRequest will be made.- Parameters:
minFresh- a non-negative integer.
-
onlyIfCached
CacheControl.Builder onlyIfCached()
Only accept the response if it is in the cache. If the response isn't cached, a
{@code 504 * Unsatisfiable MobonRequest}response will be returned.
-
noTransform
CacheControl.Builder noTransform()
Don't accept a transformed response.
-
immutable
CacheControl.Builder immutable()
-
build
CacheControl build()
-
-
-
-