public interface InternalCache
Cache.| Modifier and Type | Method and Description |
|---|---|
Response |
get(Request request) |
CacheRequest |
put(Response response) |
void |
remove(Request request)
Remove any cache entries for the supplied
request. |
void |
trackConditionalCacheHit()
Track an conditional GET that was satisfied by this cache.
|
void |
trackResponse(CacheStrategy cacheStrategy)
Track an HTTP response being satisfied with
cacheStrategy. |
void |
update(Response cached,
Response network)
Handles a conditional request hit by updating the stored cache response with the headers from
network. |
CacheRequest put(Response response) throws java.io.IOException
java.io.IOExceptionvoid remove(Request request) throws java.io.IOException
request. This is invoked when the client
invalidates the cache, such as when making POST requests.java.io.IOExceptionvoid update(Response cached, Response network)
network. The cached response body is not updated. If the stored response has changed
since cached was returned, this does nothing.void trackConditionalCacheHit()
void trackResponse(CacheStrategy cacheStrategy)
cacheStrategy.