CachePolicy


ENUM

CachePolicy

Swift
1public enum CachePolicy: Hashable

A cache policy that specifies whether results should be fetched from the server or loaded from the local cache.

Cases

returnCacheDataElseFetch

Swift
1case returnCacheDataElseFetch

Return data from the cache if available, else fetch results from the server.

fetchIgnoringCacheData

Swift
1case fetchIgnoringCacheData

Always fetch results from the server.

fetchIgnoringCacheCompletely

Swift
1case fetchIgnoringCacheCompletely

Always fetch results from the server, and don't store these in the cache.

returnCacheDataDontFetch

Swift
1case returnCacheDataDontFetch

Return data from the cache if available, else return nil.

returnCacheDataAndFetch

Swift
1case returnCacheDataAndFetch

Return data from the cache if available, and always fetch results from the server.

Properties

default

Swift
1public static var `default`: CachePolicy = .returnCacheDataElseFetch

The current default cache policy.

Feedback

Edit on GitHub

Forums