Integration Cloud 7.0.0 | Integrations | Caching Integrations
 
Caching Integrations
Caching is an optimization feature that can improve the performance of stateless integrations. When you enable caching for an integration, Integration Cloud saves the entire contents of the pipeline after invoking the integration in a local cache for the period that you specify. The pipeline includes the output fields explicitly defined in the integration, as well as any output fields produced by earlier services or steps in the flow. When the server receives subsequent requests for an integration with the same set of input values, it returns the cached result to the client rather than invoke the integration again.
Caching can significantly improve response time of integrations. For example, integrations that retrieve information from busy data sources such as high-traffic commercial web servers could benefit from caching.
When are cached results returned?
When you enable caching for an integration, Integration Cloud manages the cached results differently, depending on whether the integration has input parameters. It is recommended that a cached integration has input parameters.
When a cached integration has input parameters, at run time, Integration Cloud scopes the pipeline down to only the declared input parameters of the integration. Integration Cloud compares the scoped-down inputs to the previously stored copy of the inputs. If a cached entry exists with input parameters that have the same values, Integration Cloud returns the cached results from the previous invocation.
Note:
If a cached entry with input parameter values that are identical to the current invocation does not exist in the cache, Integration Cloud runs the integration and stores the results in the cache.
When a cached integration does not have input parameters, for example, date/time, and previous results do not exist in the cache, at run time Integration Cloud runs the integration and stores the results. When the integration runs again, Integration Cloud uses the cached copy. In other words, Integration Cloud does not use the run-time pipeline for the current invocation; you will always receive cached results until the cache expires.
Note:
If a cached integration input signature includes a Document Reference or Document Reference List variable and the referenced document type changes or is modified, you must reset the service cache. If you do not reset it, Integration Cloud uses the old, cached input parameters at run time until such time as the cached results expire. You can reset the cache from the Integrations list page. Further, If multiple Integration Cloud servers are available, then the cache is available in all servers and the cache behavior is independent. The caches are not shared between servers. For example, if you run an integration and the request is served by Server 1, then Server 1 runs the integration and caches the results. Next time if you run the same integration with the same input values, and now if Server 2 serves this request, then Server 2 runs the integration and caches the results. So executions happen and results will be cached once, in each server.
Types of integrations to cache
While caching integration results can improve performance, not all integrations must be cached. You must never cache the integrations if the cached results might be incorrect for subsequent invocations or if the integration performs tasks that must be run each time the integration is invoked. Following are guidelines for you to consider when determining whether to cache the results for an integration.
Integrations suited for caching:
*Integrations that require no state information: If a service does not depend on state information from an earlier transaction in the client’s session, you can cache its results.
*Integrations that retrieve data from data sources that are updated infrequently: Integrations whose sources are updated on a daily, weekly, or monthly basis are good candidates for caching.
*Integrations that are invoked frequently with the same set of inputs: If an integration is frequently invoked by clients using the same input values, it is beneficial to cache the results.
Integrations not suited for caching:
*Integrations that perform required processing: Some integrations contain actions that must be processed each time a client invokes it. For example, if an integration contains accounting logic to perform charge back and you cache the results, the server does not execute the integration, so the integration does not perform charge back for the subsequent invocations of the service.
*Integrations that require state information: Do not cache integrations that require state information from an earlier transaction, particularly information that identifies the client that invoked it. For example, you do not want to cache an integration that produced a price list for office equipment if the prices in the list vary depending on the client who initially connects to the data source.
*Integrations that retrieve information from frequently updated sources: If an integration retrieves data from a data source that is updated frequently, the cached results can become outdated. Do not cache integrations that retrieve information from sources that are updated in real-time or near real-time, such as stock quote systems or transactional databases.
*Integrations that are invoked with unique inputs: If an integration manages a large number of unique inputs and very few repeated requests, you gain little by caching the results. You might even degrade server performance by quickly consuming large amounts of memory.
Note:
Executions will not be cached when integrations are run from the scheduler, user interface, or when invoked asynchronously.
Enabling caching
1. Open an integration from the Integrations list page for which the caching must be enabled, and click the Settings icon. The Settings icon will appear after the caching feature is enabled. Contact Global Support to enable the caching feature.
The Cache settings dialog box appears.
2. Drag the Enable/Disable Cache switch to the right to enable the cache. The default status is Disabled.
3. In the Cache expire field, enter the number of minutes that the integration results must be stored in the cache. The expiration timer begins when the server initially caches the results. The server does not restart the expiration timer each time it retrieves the results from the cache. The minimum cache expiration time is one minute.
4. Click OK. When you save and run the integration, the results are stored in the cache only when the integration has run successfully.
Note:
You can clear the cache for the integration using the Clear cache option available on the Integrations list page. To clear the cache, go to the Integrations list page, select the integration for which you want to clear the cache, click on the ellipsis icon, and then select Clear cache.