User Guide > Push-Based Incremental Caching > Setting Up an Push-Based Incremental Cache in Studio
 
Setting Up an Push-Based Incremental Cache in Studio
For the resource being cached, storage depends on the result set output, and on retrieval of the entire result set or retrieval of a filtered subset. Decide on a storage type for caching the execution result. For information on how TDV cached data types are mapped to data source data types, see “Cache Data Type Mapping” in the TDV Reference Guide.
Note: For tables, the expiration period applies to the whole table. For procedures, each input variant’s data has its expiration tracked separately.
If a resource uses a data source that was originally added to TDV Server using the pass-through mode without saving the password, row-based security can affect the cache refresh functionality. For details on Save Password and Pass-through Login, see Adding a Data Source.
For information about the objects created by the cache, see Caching to a File Target.
To enable caching, select the cache storage type, and schedule caching
1. Make sure the data source and tables on which the view is based are set up to be monitored for changes and the data source has a connector and topic specified on which change notification messages will be received.
2. In Studio, open a view or procedure.
3. Select the Caching tab.
4. Click Create Cache.
5. Under Status, select the Enable check box.
6. Under Storage, specify the storage type as User Specified.
7. Use Browse to locate and specify the data source. After you select the data source, its full path is displayed in the Data Source field.
8. Use the Open button to open the data source to create two tables, one for storing cache status data and the other for storing cache tracking data.
9. (Optionally) If you want to rename the cache status table, in the Caching section of the data source Configuration tab, select Browse to the right of Status Table.
10. Close the data source Configuration tab. Navigate back to the view or procedure with the open Caching panel.
11. Use Browse to the right of result in the Table for Caching section to specify a location within the data source to create a table for caching.
This location can be the root level of the data source or a schema.
12. In the Select cache table for result window, select the location and type a name under Create Table.
13. Click Create, examine the DDL for result code, and click Execute.
14. Open the table you created to the Caching panel and click Create Cache.
15. On the Caching panel, select Incrementally Maintained.
16. Save the cache settings. After cache settings are saved the resource appears with a lightning-bolt icon in the Studio resource tree to show that the resource is cached.
After a brief initial data load task, the cache view is actively updated. Status for the cache is UP when the resource is saved. If cache initialization fails for any reason, clear the Incrementally Maintained check box, save the view, and then check the box again and save the view again. Because cache initialization is not automatically fault-tolerant, a retry re-initializes the cache.
When a view cache is marked as incrementally maintained and the connection to the source table or the target table caching database instance is down, the time it takes to report the connection problem depends on operating system network settings, such as the TCP default timeout.
If you have data type incompatibilities between your view and your data storage type, see “Cache Data Type Mapping” in the TDV Reference Guide to determine the best data storage option for you cache.