public interface OkResponseCache
ResponseCache
, this
interface supports conditional caching and statistics.
Modifier and Type | Method and Description |
---|---|
CacheResponse |
get(URI uri,
String requestMethod,
Map<String,List<String>> requestHeaders) |
void |
maybeRemove(String requestMethod,
URI uri)
Remove any cache entries for the supplied
uri if the request method invalidates. |
CacheRequest |
put(URI uri,
URLConnection urlConnection) |
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(CacheResponse conditionalCacheHit,
HttpURLConnection connection)
Handles a conditional request hit by updating the stored cache response
with the headers from
httpConnection . |
CacheResponse get(URI uri, String requestMethod, Map<String,List<String>> requestHeaders) throws IOException
IOException
CacheRequest put(URI uri, URLConnection urlConnection) throws IOException
IOException
void maybeRemove(String requestMethod, URI uri) throws IOException
uri
if the request method invalidates.IOException
void update(CacheResponse conditionalCacheHit, HttpURLConnection connection) throws IOException
httpConnection
. The cached response body is
not updated. If the stored response has changed since conditionalCacheHit
was returned, this does nothing.IOException
void trackConditionalCacheHit()
void trackResponse(ResponseSource source)
source
.Copyright © 2014. All rights reserved.