TXProviderBasedCache

public final class TXProviderBasedCache : TXDecoratorCache

Composite class that accepts a number of cache providers and an internal cache. The providers are then used to update the internal class in the order they are added in the providers list.

Example usage:

let cache = TXProviderBasedCache(
    providers: [
        TXDiskCacheProvider(fileURL: firstFileURL),
        TXDiskCacheProvider(fileURL: secondFileURL)
    ],
    internalCache: TXMemoryCache()
)
  • Initializes the provider based cache with a list of cache providers and an internal cache that will be initialized with the contents of those providers.

    The order of the cache providers in the list is important.

    Declaration

    Swift

    @objc
    public init(providers: [TXCacheProvider],
                internalCache: TXCache)

    Parameters

    providers

    The list of cache providers.

    internalCache

    The internal cache to be used