Loading
Feature degradation | Gmail Email delivery failureRead More
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Improve Performance by Using Caching

          Improve Performance by Using Caching

          Omnistudio offers multiple caching options to improve performance and minimize unnecessary data processing in Integration Procedures. The two primary user-configurable caching types are Org Cache and Session Cache, which are available in Integration Procedure designer. These caching mechanisms are part of the Salesforce Platform Cache and are implemented through Scale Cache in Omnistudio with standard runtime. Each serves a distinct purpose and comes with specific configuration considerations.

          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 Integration Procedures 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
            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 Integration Procedures in three ways:

          • You can cache metadata for the entire Integration Procedure.

          • You can cache the response of the entire Integration Procedure, called top-level data. See Cache for Top-Level Integration Procedure Data.

          • You can cache the result of a specific set of steps by placing the steps inside a Cache Block. See Enhance Performance by Using Cache Blocks.

            Use Cache Blocks if some parts of the Integration Procedure update data, or if you need different cached data to expire at different times. For example, current weather data changes more frequently than user session data.

          You can also perform a record-level security check for cached data. See Security for Omnistudio Data Mappers and Integration Procedures.

          Metadata Cache for Integration Procedures

          To disable metadata caching for an Integration Procedure, go to the Procedure Configuration and check the Disable Definition Cache checkbox.

          Tip
          Tip

          To test the performance benefit of metadata caching, execute the Integration Procedure in the Preview tab with Disable Definition Cache checked and then unchecked. Compare the Browser, Server, and Apex CPU values.

          Methods to Clear Metadata from the Integration Procedure Cache

          You can clear Integration Procedure metadata from the cache. You can also clear all cached data for an Integration Procedure, including session cache data, org cache data, and metadata.

          1. Go to the Developer Console.
          2. Click the user menu and select Developer Console from the menu.
          3. Select Debug | Open Execute Anonymous Window.
          4. To clear metadata cache for an Integration Procedure, in the Apex code window, execute this code:
            ConnectApi.IntegrationProcedureCacheInputRepresentation finalInput = new ConnectApi.IntegrationProcedureCacheInputRepresentation();
            ConnectApi.IntegrationProcedureCacheInputData apexInput = new ConnectApi.IntegrationProcedureCacheInputData();
            apexInput.ipKey = ipKey;
            
            List l = new List();
            l.add(apexInput);
            finalInput.ipInput = l;
            finalInput.cacheStorageType = ConnectApi.CacheStorageType.Metadata;
            ConnectApi.IntegrationProcedureCacheOutputRepresentation test = ConnectApi.OmniDesignerConnect.ClearIntegrationProcedureCache(finalInput);
            

            Here, ipkey specifies the Integration Procedure to invoke in the Type_Subtype format.

            Note
            Note Starting with Summer ‘25, replace the namespace.IntegrationProcedureService.clearMetadataCache('Type_Subtype') method with the Connect API to clear Integration Procedure metadata from the cache.
          5. To clear all cached data for an Integration Procedure, including session cache data, org cache data, and metadata, in the Apex code window, execute this code:
            ConnectApi.IntegrationProcedureCacheInputRepresentation finalInput = new ConnectApi.IntegrationProcedureCacheInputRepresentation();
            ConnectApi.IntegrationProcedureCacheInputData apexInput = new ConnectApi.IntegrationProcedureCacheInputData();
            apexInput.ipKey = ipKey;
            List l = new List();
            l.add(apexInput);
            finalInput.ipInput = l;
            finalInput.cacheStorageType = ConnectApi.CacheStorageType.All;
            ConnectApi.IntegrationProcedureCacheOutputRepresentation test = ConnectApi.OmniDesignerConnect.ClearIntegrationProcedureCache(finalInput);
            
            Note
            Note Starting with Summer ‘25, replace the omnistudio.IntegrationProcedureService.clearAllCache('Type_Subtype') method with the Connect API to clear all cached data from an Integration Procedure.
          • Cache for Top-Level Integration Procedure Data
            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.
          • Configure Top-Level Caching for an Integration Procedure
            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.
          • Turn Off the Scale Cache
            Turn off the Scale Cache globally when working with sensitive or user-specific data. This prevents such data from being cached and ensures real-time access control and data accuracy.
          • Connect APIs for Cache Management in Integration Procedures
            See this table for a summary of Connect APIs to call Integration Procedures from Apex classes. Starting Summer ’25, replace the existing methods in the IntegrationProcedureService Apex classes with the Connect APIs.
          • Enhance Performance by Using Cache Blocks
            Use Cache Blocks if some parts of the Integration Procedure update data, or if you need different cached data to expire at different times. For example, current weather data changes more frequently than user session data.
           
          Loading
          Salesforce Help | Article