Kingfisher Documentation

Structure Memory​Storage.​Config

public struct Config  

Represents the config used in a MemoryStorage.

Member Of

MemoryStorage

Represents a set of conception related to storage which stores a certain type of value in memory. This is a namespace for the memory storage types. A Backend with a certain Config will be used to describe the storage. See these composed types for more information.

Initializers

init(total​Cost​Limit:​clean​Interval:​)

public init(totalCostLimit: Int, cleanInterval: TimeInterval = 120)  

Creates a config from a given totalCostLimit value.

Parameters

total​Cost​Limit Int

Total cost limit of the storage in bytes.

clean​Interval Time​Interval

The time interval between the storage do clean work for swiping expired items. Default is 120, means the auto eviction happens once per two minutes.

Properties

total​Cost​Limit

public var totalCostLimit: Int

Total cost limit of the storage in bytes.

count​Limit

public var countLimit: Int = .max

The item count limit of the memory storage.

expiration

public var expiration: StorageExpiration  

The StorageExpiration used in this memory storage. Default is .seconds(300), means that the memory cache would expire in 5 minutes.

clean​Interval

public let cleanInterval: TimeInterval

The time interval between the storage do clean work for swiping expired items.