---
title: "Writing to a Time Cache Definition"
slug: "writing-to-a-time-cache-definition"
updated: 2025-06-20T16:10:01Z
published: 2025-06-20T16:10:01Z
---

> ## Documentation Index
> Fetch the complete documentation index at: https://documentation.decisions.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Writing to a Time Cache Definition

## Overview

To limit the amount of data saved to a **Cache** or to establish a custom expiration time for a cached **Value**, users may establish a**Time Cache Definition**. Time Cache Definitions can be used in conjunction with any other **Type**of **Cache Definition** to adjust the time the cached data exists within the Cache. In addition, the Time Cache Definitions can be used to Cache the Output of a step and store and retrieve it outside a Flow.

Additional InformationThe following document involves the use of Cache Definitions. For more information on Cache Definitions, see the [Cache Definitions](https://documentation.decisions.com/v9/docs/cache-definitions) document.

---

## Example

The following document demonstrates how to store and retrieve an email address using a TimeCacheDefinition.

1. From the **Decisions****Studio**, navigate to **System > Administration > Cache**, select ADD, then **MemoryCacheDefinition**.
2. From the MemoryCacheDefinition window, provide a Configuration Name, then click SAVE. ![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/2025-06-20_11h38_45.png)
3. From the same **Cache****Folder**, select ADD once more, then select **TimeCacheDefinition**.  
Once a time cache has been created using a cache definition, making any changes to that cache definition will not change any already existing time caches; only new instances will use updated cache definitions.![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/2025-06-20_11h40_25.png)
4. From the TimeCacheDefinition window, provide the desired Configuration Name. Then under TIME CACHE DEFINITION INFO, select the previously created MemoryCacheDefinition from the **Target Cache Config Name**dropdown.Additional Information on Target Cache Config Name Note that the Target Cache Config Name represents the Cache that the TimeCacheDefinition will be applied to. 

![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/2025-06-20_11h41_49.png)
5. Scroll to **Check On Interval Span** and establish the desired value; for this example **1****Minute**. Then, set the **Interval** value; for this example **5 Minutes**, then click SAVE.

Additional Information on Intervals These values are used to determine how long data from the associated Cache is stored in the Cache. 

![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/2025-06-20_11h42_40.png)
6. Navigate to a **Designer****Project**, then select CREATE FLOW and CREATE a new **Flow**.
7. From the **Flow** **Designer**, attach a **Create****Data**step from the FAVORITE STEPS category to the **Start** step.
8. From the Properties tab of the Create Data step, under**DATA > Data to Create**, select SHOW EDITOR.![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/2025-06-20_11h43_43.png)
9. From the **Data to Create** window, provide a NAME, select**String [Text]**from the TYPE dropdown, INPUT the desired Email. **Save**then close the window via **X**.![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/2025-06-20_11h44_32.png)
10. Back in the **Flow****Designer**, navigate to **Toolbox > SYSTEM > CACHING**, and attach a**Put In Cache**step to the Create Data step.
11. From the Put In Cache step's Properties, **Constant**map the **Cache Type Name** that corresponds to the **Name**of the TimeCacheDefinition. Constant map the desired**Cache Instance Name** and **Key**, Then Select From Flow map the Output of the Create Data step to **Value**.

Additional Information on Put In Cache PropertiesThe Storage Instance Name and Key values are used to both store and retrieve the cached data. 

![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/2025-06-20_11h47_28(1).png)
12. From the same CACHING category in the **Toolbox**tab, attach a **Get****From****Cache**step to the **Done**path of the Put In Cache step. From the newly added step's Properties, Constant map the sane Cache Instance Name, Cache Type Name, and Key values, that were used in the Put In Cache step's Properties. Then connect the **Result**path to the **End**step. ![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/2025-06-20_12h02_48(1).png)
13. Save the Flow, then if desired, close via X.

---

## Debug

1. From the **Flow****Designer**, select the **Debug**link from the top Action bar.
2. After the **Flow**runs, select **Put In Cache 1 > Execution 1 > View Input/Output Data**. Debug Results Note that as long as the Value has not expired that the resulting Output Data will reflect the Value stored in the TimeCacheDefinition. This Value will display in its original String form due to its association with the MemoryCacheDefinition. 

![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/2025-06-20_12h04_08(1).png)

---

## How Time Cache Data is Stored

By associating a **TimeCacheDefinition**with a **MemoryCacheDefinition**as a**Target Cache Config Name**, when data is stored in the **TimeCache**its **Value** is actually stored in the affiliate **MemoryCache**.

This data's record can be seen by navigating to **System > Administration > System Tools > Event Viewer**, under the **Cache****Size**tab in the format of**[TargetCacheConfigName]||[InstanceNameAffiliatedWithTimeCache]**. This record is displayed alongside a **Count**of how many items exist in that **Instance**.![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/2025-06-20_12h07_37(1).png)
