Interface InternalCache

  • All Known Implementing Classes:
    CacheAdapter

    public interface InternalCache
    OkHttp's internal cache interface. Applications shouldn't implement this: instead use Cache.
    • Method Detail

      • 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.
        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 from network. The cached response body is not updated. If the stored response has changed since cached was 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 with cacheStrategy.