Class CacheStrategy
- java.lang.Object
-
- com.squareup.okhttp.internal.http.CacheStrategy
-
public final class CacheStrategy extends Object
Given a request and cached response, this figures out whether to use the network, the cache, or both.Selecting a cache strategy may add conditions to the request (like the "If-Modified-Since" header for conditional GETs) or warnings to the cached response (if the cached data is potentially stale).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCacheStrategy.Factory
-
Field Summary
Fields Modifier and Type Field Description ResponsecacheResponseThe cached response to return or validate; or null if this call doesn't use a cache.RequestnetworkRequestThe request to send on the network, or null if this call doesn't use the network.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanisCacheable(Response response, Request request)Returns true ifresponsecan be stored to later serve another request.
-