◷ Reading Time: 4 minutes
Caching enables your model to store some data in memory and keep it for a period of time. When Caching is enabled as part of orchestration models (i.e. Flow and Workflow) the steps will be executed only if the Cache is not available, otherwise, the execution of steps with enabled cache returns the stored values from the memory rather than executing the steps.
Caching is available for the below steps from your orchestration toolbox:
- REST API call
- Excel Spreadsheet
There are two options available to manage how long a cached value remains active.
- Cache without expiry
- Expire cache based on a time
Sample Caching Scenario
When you read some static information from a data souce, you don’t need to read and access IO for every request. You can use the Caching settings of data source to ensure the results are cached for the first time and will be reused for subsequent requests.
Add a cache key for the data source
Key : Cache Key is used to reference the data that will be stored in memory. If not set, caching is disaled, otherwise you can give a string value to represent the key.
You can define your own cache key.
Cache Key should be a unique string value that holds the value in the memory. For example
To generate a Cache Key you can open the Key editor from Properties Window, and at the toolbar of the editor there is a Generate button.
Expiry : Set a value to enable caching based on operating system’s process life cycle. Value can be ‘never’ which cache will not be expired. Or else you can set a time using the interface.
Select the Properties Window, and click on the Expiry editor. You can choose a caching expiry options as below:
Once the caching option is selected for expiry the value will be updated.
Now when you run the project the data will be cached and can be accessed using the key.
Set Cache as an Execution Event
You can set a cache as an execution event for a database or REST API.
Key and Expiry will be the same as explain above.
Managing Cached Items
You can alterenatively use Cache Inspector UI for managing the Cache.
Read Cached Items
You can use
cacheList() function in the Watch window to see the list of cache values.
Remove Cached Items
You can use
cacheRemove(<key>) function in the Watch window to remove an existing cache.
To access the detailed expression list for cache management, click here.
See the attached sample project.