---
schema_version: "1"
id: 91413de04ce2eb16749b523705ddfb856d908e9bd0c7be16c5e828d1f7ad7a90
title: Cache for Top-Level Integration Procedure Data (Managed Package)
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/os_cache_for_top_level_integration_procedure_data.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.os_cache_for_top_level_integration_procedure_data.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 98c6453aa634a88a7110e8cfa54b06a52a912c1b23f13cb8732c02b084c44195
description: 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.
products:
  - Omnistudio
release: "264"
---
# Cache for Top-Level Integration Procedure Data (Managed Package)

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.

![Managed Package app icon](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio_for_managed_packages-264-0-0-production-enus/aa2554ec-624a-4ee6-8da4-6435670e6e62/resources-global/_corporate/images/managedpackageicon.png) This information is for Omnistudio for Managed Packages. For Omnistudio on standard runtime, see [Omnistudio Help](https://help.salesforce.com/s/articleView?id=xcloud.os_omnistudio_standard.htm&language=en_US).

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)](https://help.salesforce.com/s/articleView?id=xcloud.os_cache_for_dataraptors_and_integration_procedures.htm&release=264.0.0&type=5 "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.").

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)](https://help.salesforce.com/s/articleView?id=xcloud.os_configure_top_level_caching_for_an_integration_procedure.htm&release=264.0.0&type=5 "For the managed package runtime, 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.").

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio_for_managed_packages-264-0-0-production-enus/aa2554ec-624a-4ee6-8da4-6435670e6e62/images/icon_note.png)

Note

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 is `true`. 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 is `false`. Use this setting as part of testing caching itself.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio_for_managed_packages-264-0-0-production-enus/aa2554ec-624a-4ee6-8da4-6435670e6e62/images/icon_note.png)

Note

To test caching, be sure to set `ignoreCache` to `false`. See [Create a Top-Level Caching Example (Managed Package)](https://help.salesforce.com/s/articleView?id=xcloud.os_create_a_top_level_caching_example.htm&release=264.0.0&type=5 "For the managed package runtime, an Integration Procedure accepts a list of first or last names and retrieves Contacts having those names. Top-level caching to the VlocityAPIResponse partition improves Contact retrieval performance.").

The Options pane on the Preview tab looks like this:

![Under Errors/Debug Output are the Debug Log, errors, and Options panes. The Options pane is expanded to reveal resetCache, ignoreCache, and other options.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio_for_managed_packages-264-0-0-production-enus/aa2554ec-624a-4ee6-8da4-6435670e6e62/omnistudio_for_managed_packages/images/cachingpreviewoptions.png)

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)](https://help.salesforce.com/s/articleView?id=xcloud.os_integration_procedure_invocation_using_post.htm&release=264.0.0&type=5 "For the managed package runtime, to send JSON data to an Integration Procedure, issue a POST call. With a POST call, you can specify inline values in the URL path, append query parameters to the URL, and include a JSON request body.").

## 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 the `ignoreCache` setting 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)](https://help.salesforce.com/s/articleView?id=xcloud.os_integration_procedure_invocation_using_post.htm&release=264.0.0&type=5 "For the managed package runtime, to send JSON data to an Integration Procedure, issue a POST call. With a POST call, you can specify inline values in the URL path, append query parameters to the URL, and include a JSON request body.").

## Methods for Clearing Top-Level Data

If you must clear top-level Integration Procedure data from the cache, follow the instructions in [this topic](https://help.salesforce.com/s/articleView?id=xcloud.os_fix_the_datapack_import_export_error_no_configuration_found.htm&release=264.0.0&type=5 "For the managed package runtime, if you see the error message No Configuration Found while trying to import or export a DataPack, the issue is most likely with the configuration of the Salesforce org. This error often occurs in developer sandboxes that are missing some of the configuration files owing to a recent refresh or an install or upgrade that has missed a post-install or post-upgrade step. You can fix this error with code in Anonymous Apex."), 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](https://help.salesforce.com/s/articleView?id=xcloud.os_fix_the_datapack_import_export_error_no_configuration_found.htm&release=264.0.0&type=5 "For the managed package runtime, if you see the error message No Configuration Found while trying to import or export a DataPack, the issue is most likely with the configuration of the Salesforce org. This error often occurs in developer sandboxes that are missing some of the configuration files owing to a recent refresh or an install or upgrade that has missed a post-install or post-upgrade step. You can fix this error with code in Anonymous Apex."), 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');
```