For the managed package runtime, Omnistudio offers multiple caching options to improve performance and minimize unnecessary data processing in Data Mappers. The two primary user-configurable caching types are Org Cache and Session Cache, which are available in the Data Mapper designer. These caching mechanisms are part of the Salesforce Platform Cache and are implemented through Vlocity Cache in Omnistudio with managed package runtime. Each serves a distinct purpose and comes with specific configuration considerations.
This information is for Omnistudio for Managed Packages. For Omnistudio on standard runtime, see Omnistudio Help.
Caching of Data Mapper metadata is available in Summer '19 and later releases. Caching of Data Mapper data is available in Spring '20 and later releases.
Omnistudio also offers Metadata Cache, which is for internal use only. It’s not configurable by users. It stores Omnistudio component metadata or definitions, and not the actual data. You can configure the data to remain in the cache (time to live) for a maximum of 48 to 72 hours.
Omnistudio caches two different types of content:
- Metadata: The definition that includes the structure and configuration of Integration Procedures and Data Mappers, such as steps, mappings, and formulas. This is stored in Metadata Cache and is used to improve load times.
- Data: The response of a Data Mapper or an Integration Procedure that is cached in the Session Cache or Org Cache. Every time, when the same request input is entered or provided, the cached data is returned.
Types of data cache in Data Mappers include:
- Org Cache: The cached data is shared among all users in the same org. The org cache is
recommended only if the data is non-sensitive or not user-specific. For example,
picklists, configurations, or object data without any access restrictions. You can
configure the data to remain in the cache (time to live) for a maximum of 48 hours.Important
Use org cache only for non-sensitive data.
- Session Cache: It stores user-specific data and is limited to active user sessions. It is safer for personalized data and helps reduce redundant processing for data that varies by user profile or permissions. You can configure the data to remain in the cache (time to live) for a maximum of 8 hours.
You can use caching with Data Mappers in three ways:
-
Data Mapper metadata is automatically cached. If you use the Scale Cache, this automatic caching occurs unless you turn off the Scale Cache. If you use the Platform Cache, you must allocate space in the VlocityMetadata cache partition to enable this automatic caching.
-
You can configure data caching on the Options tab of Data Mapper Extracts, Turbo Extracts, and Transforms.
-
If you call a Data Mapper from an Integration Procedure that uses caching, the Data Mapper data is cached along with the Integration Procedure data.
You can also perform a record-level security check for cached data.
Metadata Cache for Data Mappers
Before you can cache Data Mapper metadata in the Platform Cache, you must allocate space in the VlocityMetadata cache partition. See Allocate Space in the Platform Cache Partitions. Data Mapper metadata is automatically cached.
If the Data Mapper cache isn't refreshed, make sure that Setup > Custom Settings > Trigger Setup > AllTriggers is on.
Methods to Clear Metadata from Data Mapper Cache
If you must clear Data Mapper metadata from the cache, follow the instructions in this topic, but execute one of these lines of code instead:
namespace.DRGlobal.clearCacheForDataRaptor('DataRaptorName');
vlocity.cmt.DRGlobal.clearCacheForAllDataRaptor();
Methods to Clear Data from the Scale Cache
Data Mappers use the Scale Cache and not the Platform Cache. To clear the Scale Cache, you can use either the preceding methods or the following ScaleCacheService method.
namespace.ScaleCacheService.invalidateCacheValue(new Map<String, String>{'DataRaptorId' => DataRaptor_Name});
For example, to clear data from a Data Mapper named ExtractContactName, use this line of code:
omnistudio.ScaleCacheService.invalidateCacheValue(new Map<String, String>{'DataRaptorId' => 'ExtractContactName'});
namespace.ScaleCacheService.invalidateCacheValue(new Map<String, String>{'VIPId' => Type_SubType});