Package com.squareup.okhttp.internal
Interface InternalCache
-
- All Known Implementing Classes:
CacheAdapter
public interface InternalCacheOkHttp's internal cache interface. Applications shouldn't implement this: instead useCache.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Responseget(Request request)CacheRequestput(Response response)voidremove(Request request)Remove any cache entries for the suppliedrequest.voidtrackConditionalCacheHit()Track an conditional GET that was satisfied by this cache.voidtrackResponse(CacheStrategy cacheStrategy)Track an HTTP response being satisfied withcacheStrategy.voidupdate(Response cached, Response network)Handles a conditional request hit by updating the stored cache response with the headers fromnetwork.
-
-
-
Method Detail
-
get
Response get(Request request) throws IOException
- Throws:
IOException
-
put
CacheRequest put(Response response) throws IOException
- Throws:
IOException
-
remove
void remove(Request request) throws IOException
Remove any cache entries for the suppliedrequest. This is invoked when the client invalidates the cache, such as when making POST requests.- Throws:
IOException
-
update
void update(Response cached, Response network) throws IOException
Handles a conditional request hit by updating the stored cache response with the headers fromnetwork. The cached response body is not updated. If the stored response has changed sincecachedwas returned, this does nothing.- Throws:
IOException
-
trackConditionalCacheHit
void trackConditionalCacheHit()
Track an conditional GET that was satisfied by this cache.
-
trackResponse
void trackResponse(CacheStrategy cacheStrategy)
Track an HTTP response being satisfied withcacheStrategy.
-
-