Caching Data for DiveTab
The DiveLine server caches all requests made through the Spectre engine. By default, the cache is stored in the dl-dataroot\cache\spectre directory, but this directory can be reconfigured. If you request something once, it is likely that you will request it again; when this happens, the data is cached from your first request and can be retrieved from the cache.
Cache files are named based on their contents, so file names are reused and old files are overridden. However, during periods of active development, you might end up with inaccessible stale entries. In such cases, a nightly sweep may be good practice to remove unused files.
The Spectre cache files are shared by like users, that is, the cache is shared among users with similar access settings. When an application like DiveTab runs and syncs its pages, data is cached on the device. This makes things speedier and available for offline usage. However, DiveTab can be configured so that it has the potential for 10,000 dives that need to be computed and downloaded when synced. It can take two minutes for 60,000 dives to be calculated. Rather than add the calculation time to the data transfer time, you have options to pre-cache the calculations. This way, the data to be synced is already calculated, and the Sync button simply transfers the data.
For offline use, DiveTab downloads cBase and cPlan data locally, and only parts are loaded into memory to service dives. Offline cBases can be up to 400 MB, and dive results up to 200 MB.
There are multiple options for pre-caching Spectre data:
- The Production node CacheDT (for DiveTab only)
- The cacheseed.jar program to simulate a DiveTab Sync operation
- The Production node Spectre Cache Refresh
In addition, certain DiveTab tags can control what is included in the cache:
- The preload tag for Report and Ad Hoc pages
- The no-preload tag for Central pages
The preload=true tag determines dives in advance to make tables load faster in the interface. Avoid using preload=true if dive results exceed 200 MB.
The following notes apply when working with a DiveTab application:
- For a DiveTab application, the initial page views, as well as changing dimension views, are included in the sync. When you start diving, whether through Dive Dimensions or page parameters, this is an online activity. As you dive, it is equivalent to the Diver console showing Dimcounts. Depending on your usage pattern, data reached through Dives could have already been downloaded, but there is no guarantee.
-
Include a Production script in your processes to simulate a DiveTab Sync. CacheDT tells DivePort to do a sync for the DiveTab configuration. Dives are calculated and stored in the cache area. Then, the dives are available for transfer to the iPad or PC. When you use the cache like this, you are giving your process an extra boost by eliminating the computation time for the sync data.
- The cacheseed.jar utility simulates a sync operation so that the data goes into the tables in the Spectre cache directory, dl-dataroot/cache/spectre. If the seed operation is not complete, DiveTab grabs what is available and the DiveLine server computes the rest spontaneously. The Sync operation must finish before you can use your DiveTab client. If the Sync takes more than 10 to 15 minutes, it should be run in the background on your iOS device or Windows computer.
- Caching is a post processing step. That is, the cBase data is available when the build is complete, but the cache is done after the build, and is another boost for DiveTab.
- You can tag a Report page or a dimension in an Ad Hoc page to force the page or dimension to be included in a sync. Use the tag preload.
- Central pages are always cached by default, but you can turn off that option by using the no-preload tag.
- As of DiveTab 7.1.14, when using a web page, DiveTab stores user information in the cache directory.
- Note that when an administrator using Workbench during the day updates user property values, related cache entries are marked as stale.
See also: