CachePolicy

View as Markdown

CachePolicy

The cache policies allow you to define the source from where the SDK will retrieve the content.

NameTypeDescription
networkOnly CachePolicy

The SDK retrieves data through a network call, and saves the retrieved data in the cache. This is set as the default policy.

cacheOnly CachePolicy

The SDK gets data from the cache.

cacheElseNetwork CachePolicy

The SDK gets data from the cache. However, if it fails to retrieve data from the cache, it makes a network call.

networkElseCache CachePolicy

The SDK gets data using a network call. However, if the call fails, it retrieves data from cache.

cacheThenNetwork CachePolicy

The SDK gets data from cache, and then makes a network call. (A success callback will be invoked twice.