public interface OkResponseCache
ResponseCache, this
interface supports conditional caching and statistics.
| Modifier and Type | Method and Description |
|---|---|
com.squareup.okhttp.internal.http.Response |
get(com.squareup.okhttp.internal.http.Request request) |
boolean |
maybeRemove(com.squareup.okhttp.internal.http.Request request)
Remove any cache entries for the supplied
uri. |
CacheRequest |
put(com.squareup.okhttp.internal.http.Response response) |
void |
trackConditionalCacheHit()
Track an conditional GET that was satisfied by this cache.
|
void |
trackResponse(ResponseSource source)
Track an HTTP response being satisfied by
source. |
void |
update(com.squareup.okhttp.internal.http.Response cached,
com.squareup.okhttp.internal.http.Response network)
Handles a conditional request hit by updating the stored cache response
with the headers from
network. |
com.squareup.okhttp.internal.http.Response get(com.squareup.okhttp.internal.http.Request request)
throws IOException
IOExceptionCacheRequest put(com.squareup.okhttp.internal.http.Response response) throws IOException
IOExceptionboolean maybeRemove(com.squareup.okhttp.internal.http.Request request)
throws IOException
uri. Returns true if the
supplied requestMethod potentially invalidates an entry in the
cache.IOExceptionvoid update(com.squareup.okhttp.internal.http.Response cached,
com.squareup.okhttp.internal.http.Response network)
throws IOException
network. The cached response body is not
updated. If the stored response has changed since cached was
returned, this does nothing.IOExceptionvoid trackConditionalCacheHit()
void trackResponse(ResponseSource source)
source.Copyright © 2014. All Rights Reserved.