Caching data in offline-enabled mobile apps
Help users begin their work without unnecessary delays by enabling caching in offline-enabled mobile apps and including the cached data in the app executable files. By caching common rules and storing them in the app bundle, you ensure that the app starts faster when users launch it for the first time.
- Do not enable caching of common data in the app development testing stages because frequent model changes in these stages require forced full synchronizations to update the model. For more information, see Propagating application model changes to offline-enabled mobile apps.
- When you include the cached node-scope data pages in the app installation package, you might expose potentially sensitive data when, for example, you distribute the app through Google Play or the Apple App Store.
- Depending on your application model complexity, the size of the app installation package might significantly increase when you include the cached content and node-scope data pages in the app bundle.
- If you circumstance rules and data pages in your application, consider not enabling caching. The app evaluates circumstancing during packaging, which means that all users only get the data that matches the circumstancing conditions for the first user. For more information, see Creating a rule specialized by circumstance.
After users log in to the app, the packaging process determines the scope of the data that the app downloads during data synchronization. When you configure your offline-enabled app to cache common data, such as rules and static data, the package already contains the cached content and can immediately download the necessary data. Further, you can include the cached data in the app executable file. This approach ensures that the initial data synchronization is faster because the app synchronizes only the data that differs between the package and the current server state.
Open your mobile channel:
In the navigation pane of App Studio, click Channels.
In the Current channel interfaces section, click the tile that represents a mobile channel for your app.
On the mobile channel page, on the Configuration tab, click the Offline category.
Expand the Advanced section, and then, in the Caching section, select the Cache common rules check box.
To control the caching of node-scope data pages, perform one of the following sets of actions:
- To cache specific node-scope data pages in addition to common rules, select Additionally cache node scope data pages listed below, and then enter the names of the node-scope data pages.
- To cache all node-scope data pages, select Additionally cache all node scope data pages except for those listed below.
- To cache all node-scope data pages in addition to common rules, but also exclude specific node-scope data pages from caching, select Additionally cache all node scope data pages except for those listed below, and then enter the names of the node-scope data pages that you want to exclude.
To include the cached data in the app executable file for even faster startup, select the Include cache contents in the installation package check box.