Search…
Caching
Perform queries through network or local lookups.
In order to provide eventual consistency to users' data, the Virtual Cards SDK caches the results of each method call result to the Virtual Cards 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 call to the Virtual Cards Service to access the appropriate records directly from the service. When used as the selected cache policy, this will add and refresh new and existing records in the cache, as well as return the latest data set.

CacheOnly

This policy will not call out to the Virtual Cards Service, but will instead use any existing cached result of previous API calls used with 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. If wanting to filter the results, a filtered API call to the service will need to be performed first.
Last modified 1yr ago