类 CacheStrategy

java.lang.Object
com.lark.oapi.okhttp.internal.cache.CacheStrategy

public final class CacheStrategy extends Object
Given a request and cached response, this figures out whether to use the network, the cache, or both.

Selecting a cache strategy may add conditions to the request (like the "If-Modified-Since" header for conditional GETs) or warnings to the cached response (if the cached data is potentially stale).

  • 字段详细资料

    • networkRequest

      @Nullable public final Request networkRequest
      The request to send on the network, or null if this call doesn't use the network.
    • cacheResponse

      @Nullable public final Response cacheResponse
      The cached response to return or validate; or null if this call doesn't use a cache.
  • 方法详细资料

    • isCacheable

      public static boolean isCacheable(Response response, Request request)
      Returns true if response can be stored to later serve another request.