For the managed package runtime, using a cache to store frequently accessed, infrequently updated Integration Procedure data saves round trips to the database and improves performance. You can cache all the data for an Integration Procedure, as described here, or you can use a Cache Block to cache only part of it.
This information is for Omnistudio for Managed Packages. For Omnistudio on standard runtime, see Omnistudio Help.
Caching of top-level Integration Procedure data is available in Summer '19 and later releases.
It's important to allocate space in the VlocityAPIResponse cache partition and to understand how top-level Integration Procedure caching interacts with Cache Blocks. See Cache for Omnistudio Data Mappers (Managed Package).
To configure top-level caching for an Integration Procedure, go to the Procedure Configuration and set the Salesforce Platform Cache Type and Time To Live In Minutes properties. See Configure Top-Level Caching for an Integration Procedure (Managed Package).
If an Integration Procedure that has top-level caching enabled fails, its data isn’t cached.
Options in Preview for Top-Level Caching
When you test an Integration Procedure that uses top-level caching in the Preview tab, you can use two caching settings in the Options JSON section. These settings control top-level data and have no effect on the metadata cache.
-
ignoreCache— Doesn't clear or save data to the cache. The default value istrue. Use this setting to test Integration Procedure steps without the possible interference of caching effects. -
resetCache— Forces data to be saved to the cache. The default value isfalse. Use this setting as part of testing caching itself.
To test caching, be sure to set ignoreCache to
false. See Create a Top-Level Caching Example (Managed Package).
The Options pane on the Preview tab looks like this:
You can pass ignoreCache and resetCache as parameters when you invoke an Integration
Procedure that uses caching using a REST API. For example, you can include ?resetCache=true in the URL to force caching. See Integration Procedure Invocation Using POST (Managed Package).
Top-Level Caching JSON Nodes and REST Headers
If top-level caching is configured and the Integration Procedure is active, the Integration Procedure JSON can include the following nodes under the root node:
-
vlcCacheKey— Key for any data stored in the cache -
vlcCacheResult— Included and set to true if data is retrieved from the cache -
vlcCacheEnabled— Included and set to false if theignoreCachesetting disables caching -
vlcCacheException— Any caching errors
These nodes are returned as headers if you invoke an Integration Procedure that uses top-level caching using a REST API. See Integration Procedure Invocation Using POST (Managed Package).
Methods for Clearing Top-Level Data
If you must clear top-level Integration Procedure data from the cache, follow the instructions in this topic, but execute one of these lines of code instead:
IntegrationProcedureService.clearSessionCache('Type_Subtype', new Map<String, Object>{'key' => 'value'});
IntegrationProcedureService.clearOrgCache('Type_Subtype', new Map<String, Object>{'key' => 'value'});
IntegrationProcedureService.clearSessionCache('vlcCacheKey');
IntegrationProcedureService.clearOrgCache('vlcCacheKey');
You can clear all cached data for an Integration Procedure, including session cache data, org cache data, and metadata. Follow the instructions in this topic, but execute this line of code instead, specifying the Integration Procedure's Type and Subtype:
IntegrationProcedureService.clearAllCache('Type_Subtype');
For example, execute the following code if:
-
You want to clear data in the Org Cache
-
The Type_Subtype parameter for the Integration Procedure is LastNames_Cached
-
The key you want to clear is ContactLastName
-
The key's value is Smith
IntegrationProcedureService.clearOrgCache('LastNames_Cached', new Map<String, Object>{'ContactLastName' => 'Smith'});
The following example clears the session cache using a vlcCacheKey value:
IntegrationProcedureService.clearSessionCache('2032076016a1745801061oc');