CachePolicy
CachePolicy
CachePolicy chooses where a fetch or find call gets its data: the network, the on-device cache, or both. Set it on the cachePolicy property of an Entry, a Query, an Asset, an AssetLibrary, or a GlobalField before the call. Every one of those properties starts as NETWORK_ONLY.
ContentstackDefinitions.h declares the enum as NS_ENUM(NSUInteger, CachePolicy). Swift imports it as CachePolicy with the same case names, for example .NETWORK_ELSE_CACHE.
Known issue: only NETWORK_ONLY and NETWORK_ELSE_CACHE work as named. CACHE_ONLY, CACHE_ELSE_NETWORK, and CACHE_THEN_NETWORK never read the cache: they send a network request and store the response. For an offline fallback, use NETWORK_ELSE_CACHE.