1. Home
  2. Caching


◷ 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 of 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:

  • File
  • REST API call (Get Verb only)
  • Excel Spreadsheet

There are two options available to manage how long a cached value remains active.

  1. Cache without expiry
  2. Expire cache based on a time

Note the expired cached values still remain in memory and consued memory. If you need to cleanup cache you can use cacheRemove function.

Sample Caching Scenario

When you read some static information from a file, you don’t need to read and access IO for every request. You can use the Caching settings of File to ensures the results are cached for the first time and will be reused for subsequent requests.

1. To start, create a Flow as below model. Add a File node to read a file.

2. Add a cache key

Cache Key should be a unique string value that holds the value in the memory. For example 1d915d77-eb2d-4c17-b18b-a2d397ec16ba

If Cache Key is not defined, the values will not be cached.

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.

Generator to create a unique Cache Key

3. Add Expiry

Select the Properties Window, and click on the Expiry editor. You can choose a caching option as below:

Once the caching option is selected for expiry the value will be updated.

4. Now when you run the project the data will be cached and can be accessed using the key.

Managing Cached Items

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.

Sample Project

See the attached sample project (Cache.zip)

Updated on March 31, 2020

Article Attachments

Was this article helpful?