Caching

Perform queries through network or local lookups

In order to provide eventual consistency to users' data, the Email SDK caches the results of each method call result from the Email Service. This allows the ability to provide your users with real-time synchronization of data updates with the service.

For optimal behavior, cached results are best used to serve offline/fast data to the user while performing a background sync/update to deliver new information to the user.

Sudo CachePolicy

Some access APIs offer the ability to provide a CachePolicy property to determine the approach that is used to access the data. The two policies offered are RemoteOnly and CacheOnly .

RemoteOnly

This policy will access the appropriate records directly from the Email Service. When used as the selected cache policy, this will add and refresh new and existing records to the cache, as well as return the latest data set.

CacheOnly

This policy will not call out to the Email Service, but will instead use any existing cached result of previous API calls used with the RemoteOnly policy. This policy comes with a caveat; queried results are cached 'as called'. This means that a cached query will only match a direct query result to the service (using RemoteOnly). For instance, if a call is made to get all results using RemoteOnly, and then a filter call is applied using CacheOnly, all the same results from the previous call are returned.

Last updated