Caching

Caching is used to speed up loading of requested data to a user's mobile device. Cache is a copy of data obtained from data source resource saved at mobile platform server. When data is requested from a mobile device the server returns update from the saved cache without addressing to data source. This reduces time for request processing.

TIP. If the amount of requested data is small, use transfer of transaction data to process response on lost connection.

Cache stores data source responses with specifying versions, cache saving date, cache validity expiration time, information for comparing request with cache: target resource, credentials used on data source request, and input request parameters. Resource cache is available to control caches by parameters in the Cache Control subsection.

Delta is a difference between two versions of resource data that enables a mobile device to restore new resource version from the stored old version.

Delta contains the following for each resource table:

For details about delta use in requests, see the Designating Delta Versions in Requests section.

Apart from version number, resource cache contains the ETag unique identifier sent together with data or delta. If the unique identifier is specified in the request, mobile platform server automatically determines cache version, to which request corresponds; it calculates and sends delta to a mobile device between the request and the latest cache version at the server.

Interaction of mobile device, mobile platform server, and data source on caching:

Data refresh algorithm on a mobile device:

  1. A mobile device sends request to data refresh.

  2. The mobile platform server checks if requested data cache is actual:

  1. Delta is sent to a mobile device from the mobile platform server.

  2. The mobile device restores actual version based on the saved data and obtained delta.

Cache use scheme when working with one resource:

To use caching, select the Cache checkbox that is available after resource import. If the checkbox is selected, additional caching parameters are displayed:

Set caching parameters:

NOTE. If the number of strings is not specified, speed of cache writing is maximum, although memory use is also maximum.

NOTE. Stored old versions occupy memory at mobile platform server.

Change resource input parameters to get a data slice via requests, and click the Save button. The resource is added to the list of data source resources, and its input parameters are available to control resource cache.

Requests to data source resources are given in the Method for Working with Table Resources section.

See also:

Import of Data Source Resources | Resource Parameters