Package 

Class CacheStrategy


  • 
    public final class CacheStrategy
    
                        

    Given a mobonRequest and cached response, this figures out whether to use the network, the cache, or both.

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

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      public class CacheStrategy.Factory
    • Method Summary

      Modifier and Type Method Description
      static boolean isCacheable(MobonResponse mobonResponse, MobonRequest mobonRequest) Returns true if {@code mobonResponse} can be stored to later serve another mobonRequest.
      • Methods inherited from class java.lang.Object

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

      • isCacheable

         static boolean isCacheable(MobonResponse mobonResponse, MobonRequest mobonRequest)

        Returns true if {@code mobonResponse} can be stored to later serve another mobonRequest.