OnlineCachePolicy

public enum OnlineCachePolicy
extension OnlineCachePolicy: Equatable

The cache which is being used while fetching map tiles.

  • A cache policy to entirely disgards caching.

    Declaration

    Swift

    case noCache
  • A cache policy which allows caching. Associated values are memoryCapacity, diskCapacity, and cacheDurationFilter. The associated values are described as follows: memoryCapacity: The caching capacity, in bytes, while caching the tiles to system memory. diskCapacity: The caching capacity, in bytes, while caching the tiles to disk. cacheDurationFilter: Mapping of the data duration in cache to the corresponding request URL filter. When an HTTP response is cacheable, if the request URL contains the String, then the entry will be stored in cache for a Measurement of time.

    Declaration

    Swift

    case cache(
        memoryCapacity: Measurement<UnitInformationStorage>,
        diskCapacity: Measurement<UnitInformationStorage>,
        cacheDurationFilter: [String: Measurement<UnitDuration>]
    )

Public

  • A policy that doesn’t specify a maximum amount of time that a fetched resource should be allowed to remain in cache. Instead, this would be handled by the server. The default maximum number of bytes that cache should use to store its data is 50MB for disk, and 5MB for memory.

    Declaration

    Swift

    public static var `default`: OnlineCachePolicy

Equatable

  • An operation to compare two instances of OnlineCachePolicy. It does this by comparing the types of the cache policy and additional meta-data if needed. If the types are otherwise identical but contain additional meta-data, then an additional comparison step is triggered. If the meta-data also matches, this operation returns true.

    Declaration

    Swift

    public static func == (lhs: OnlineCachePolicy, rhs: OnlineCachePolicy) -> Bool

    Parameters

    lhs

    A OnlineCachePolicy to compare.

    rhs

    Another OnlineCachePolicy to compare.

    Return Value

    a Boolean value indicating the equality of two instances of OnlineCachePolicy.