Package 

Interface InternalCache


  • 
    public interface InternalCache
    
                        

    OkHttp's internal cache interface. Applications shouldn't implement this: instead use .

    • Method Summary

      Modifier and Type Method Description
      abstract MobonResponse get(MobonRequest mobonRequest)
      abstract CacheRequest put(MobonResponse mobonResponse)
      abstract void remove(MobonRequest mobonRequest) Remove any cache entries for the supplied {@code mobonRequest}.
      abstract void update(MobonResponse cached, MobonResponse network) Handles a conditional mobonRequest hit by updating the stored cache response with the headers from {@code network}.
      abstract void trackConditionalCacheHit() Track an conditional GET that was satisfied by this cache.
      abstract void trackResponse(CacheStrategy cacheStrategy) Track an HTTP response being satisfied with {@code cacheStrategy}.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • remove

         abstract void remove(MobonRequest mobonRequest)

        Remove any cache entries for the supplied {@code mobonRequest}. This is invoked when the clientinvalidates the cache, such as when making POST requests.

      • update

         abstract void update(MobonResponse cached, MobonResponse network)

        Handles a conditional mobonRequest hit by updating the stored cache response with the headers from {@code network}. The cached response body is not updated. If the stored response has changedsince {@code cached} was returned, this does nothing.

      • trackConditionalCacheHit

         abstract void trackConditionalCacheHit()

        Track an conditional GET that was satisfied by this cache.

      • trackResponse

         abstract void trackResponse(CacheStrategy cacheStrategy)

        Track an HTTP response being satisfied with {@code cacheStrategy}.