Class DiskCacheStrategy


  • public abstract class DiskCacheStrategy
    extends java.lang.Object
    Set of available caching strategies for media.
    • Constructor Detail

      • DiskCacheStrategy

        public DiskCacheStrategy()
    • Method Detail

      • isDataCacheable

        public abstract boolean isDataCacheable​(DataSource dataSource)
        Returns true if this request should cache the original unmodified data.
        Parameters:
        dataSource - Indicates where the data was originally retrieved.
      • isResourceCacheable

        public abstract boolean isResourceCacheable​(boolean isFromAlternateCacheKey,
                                                    DataSource dataSource,
                                                    EncodeStrategy encodeStrategy)
        Returns true if this request should cache the final transformed resource.
        Parameters:
        isFromAlternateCacheKey - true if the resource we've decoded was loaded using an alternative, rather than the primary, cache key.
        dataSource - Indicates where the data used to decode the resource was originally retrieved.
        encodeStrategy - The EncodeStrategy the ResourceEncoder will use to encode the resource.
      • decodeCachedResource

        public abstract boolean decodeCachedResource()
        Returns true if this request should attempt to decode cached resource data.
      • decodeCachedData

        public abstract boolean decodeCachedData()
        Returns true if this request should attempt to decode cached source data.