接口 InternalCache


public interface InternalCache
OkHttp's internal cache interface. Applications shouldn't implement this: instead use Cache.
  • 方法详细资料

    • get

      @Nullable Response get(Request request) throws IOException
      抛出:
      IOException
    • put

      抛出:
      IOException
    • remove

      void remove(Request request) throws IOException
      Remove any cache entries for the supplied request. This is invoked when the client invalidates the cache, such as when making POST requests.
      抛出:
      IOException
    • update

      void update(Response cached, Response network)
      Handles a conditional request hit by updating the stored cache response with the headers from network. The cached response body is not updated. If the stored response has changed since cached was returned, this does nothing.
    • trackConditionalCacheHit

      void trackConditionalCacheHit()
      Track an conditional GET that was satisfied by this cache.
    • trackResponse

      void trackResponse(CacheStrategy cacheStrategy)
      Track an HTTP response being satisfied with cacheStrategy.