Appearance
Client-Side Caching
The web-client application requires to load all relevant operational model data from the server. Since the Data Model is hierarchical, the caching strategy makes use of that. Client-Side Caching is an essential part off Offline Support.
It is used to implement Offline Mode, but also to speed up server interactions.
Data Assets
Example
To instruct aeppic to cache all documents located in system
we can add the following policy to the cache.
ts
Aeppic.Cache.addPolicy({
name: 'system',
queries: Aeppic.Query.descendants('system'),
refresh: 'onboot',
strategy: 'stale-subscriptions',
evict: 'never',
reason: 'We need /system all the time :)',
})
This will add named policy which will load all descendants of system to the local application cache.
The Cache Controller (which is exposed as Aeppic.Cache
) loads any previously configured policies on boot.
The controller is actually running in a service worker and not on the UI thread. The Aeppic.Cache object allows interacting with the shared controller. If the installed service worker does not expose a cache controller Aeppic.Cache
silently ignores all calls.
The policy descriptions itself, are stored in local storage associated with the current login info.