# Cache -------------------------------------------------------------------------------- title: "Introduction" description: "Catalyst provides a robust, fully-managed cache in-memory for real-time use cases to store ephemeral data in your applications." last_updated: "2026-09-02T11:24:40.076Z" source: "https://docs.catalyst.zoho.com/en/cloud-scale/help/cache/introduction/" service: "Cloud Scale" -------------------------------------------------------------------------------- # Cache ### Introduction Cache is a small storage component of the Catalyst Cloud Scale service that enables faster retrieval of actively used data. It is designed to store ephemeral data or frequently accessed information, helping reduce the load on primary databases. This cache component, powered by Catalyst, plays a crucial role in memory-intensive real-time applications or microservices that demand sub-millisecond responses. In such dynamic cloud-based applications, frequent read and write operations are common. Relying on the primary data storage for every transaction becomes costly in terms of latency and can degrade overall application performance. As an in-memory component, Catalyst Cache handles large volumes of data transmission with minimal latency, significantly enhancing application performance and ensuring a smooth user experience. It is offered as an independent, in-memory service that can be used alongside or separately from your main data storage. Catalyst allows you to partition cache memory into segments and manage cache items directly from the console, making it highly effective for dynamic and performance-critical applications. To learn about using Catalyst cache in the development and production environments, visit the Environments help page. <br> <br> ### SDK and API documentation You can also work with Catalyst cache using the SDKs or the API. These enable you to fetch, insert, or update cache items in your project, and perform other actions. For more information and code samples on working in these programming environments, refer to these help pages: * Cache - Java SDK * Cache - Node.js SDK * Cache - Python SDK * Cache - API -------------------------------------------------------------------------------- title: "Key Concepts" description: "Catalyst provides a robust, fully-managed cache in-memory for real-time use cases to store ephemeral data in your applications." last_updated: "2026-09-02T11:24:40.077Z" source: "https://docs.catalyst.zoho.com/en/cloud-scale/help/cache/key-concepts/" service: "Cloud Scale" -------------------------------------------------------------------------------- # Key Concepts Before you learn more about the architecture of Catalyst cache, it's important to familiarize yourself with some of its fundamental concepts. ### Segments Catalyst cache is divided into partitions called segments. Each segment represents a cache unit. Cache segments can be created to categorize and organize data used for similar purposes. Each cache segment can contain several cache items where the data to be cached is stored. You can only create a cache segment from the Catalyst console. Once a segment is created, you can view or update its cache items from the console or in your application using the APIs. Whenever a cache segment is created, a unique **Segment ID** is created for it automatically. You can refer to the segment using its ID. You can find the segment ID of a cache in the Cache component page from Catalyst console. There is also a **default segment** in your cache that is created automatically when you create a project. If you cache data without having created a segment, or if you don't specify the Segment ID for an operation using the SDKs or API, the default segment will be accessed. ### Cache Items A cache item is primarily a key-value pair, that contains a keyname and a corresponding value. A cache item in Catalyst contains the following attributes: * **Keyname**: The unique identifying name of the cache item. * **Value**: The value of the cache item. * **Expiration Time**: Defines the time of validity of the cache item in hours. The default expiration time of data in a cache item is **two days**. Any data that crosses two days of validity will be deleted from the cache memory automatically. You can override the default expiration time of a cache item and set it to a time within two days or less. -------------------------------------------------------------------------------- title: "Architecture" description: "Catalyst provides a robust, fully-managed cache in-memory for real-time use cases to store ephemeral data in your applications." last_updated: "2026-09-02T11:24:40.077Z" source: "https://docs.catalyst.zoho.com/en/cloud-scale/help/cache/architecture/" service: "Cloud Scale" -------------------------------------------------------------------------------- ### Architecture Catalyst implements and manages Redis cache which is backed by Zoho's powerful infrastructure. Redis is an open-source, in-memory key-value data store structure. Redis data is stored in the server's main memory as opposed to popular databases that store the data on disk. Since the data resides in-memory, accessing it avoids seek time delays and facilitates sub-millisecond response time for real-time applications. For more information, refer to the official documentation of Redis. Catalyst manages the behind-the-scenes functionalities of the Redis cache for you, allowing you to entirely focus on a higher-value application development. It handles the hardware provisioning and the multi-tenant architecture of the Redis cache. It also maintains compatibility with Redis APIs, enabling you to build functionality-rich applications without any hassles. A single standard cluster in Redis caters caching services for multiple users, while Catalyst handles the segregation and allocation of resources. For example, when you create cache items for two different projects from your Catalyst account, the data of both applications might be stored in a single dedicated cluster in Redis. The identity of a cache item's source project is uniquely marked, and the cache items in the same cluster are efficiently segregated by Catalyst. Catalyst therefore prevents collisions of cache items of different projects in the cluster, and returns the right cache item's value when requested. This is highly beneficial when the keynames of the cache items are the same in both the projects. -------------------------------------------------------------------------------- title: "Lifecycle" description: "Catalyst provides a robust, fully-managed cache in-memory for real-time use cases to store ephemeral data in your applications." last_updated: "2026-09-02T11:24:40.077Z" source: "https://docs.catalyst.zoho.com/en/cloud-scale/help/cache/lifecycle/" service: "Cloud Scale" -------------------------------------------------------------------------------- ### Lifecycle The life cycle of a cache item can be summed up in the following steps: 1. A user creates a cache segment in a project. A unique identification is created that identifies the segment in the Redis cluster. 2. When a cache item is created in that segment, it is bound with that segment through internal logic. 3. All cache items that are created in various segments are stored in the same dedicated cluster along with other cache items of different segments, projects, and users. This segregation is handled by Zoho. 4. Every time a read operation is performed, Catalyst checks the cluster for the required data using internal identifications. If the data is present, it is retrieved, and the API response is received with the requested data. 5. All cache items reside in-memory until their expiration time, unless they are deleted by the users. -------------------------------------------------------------------------------- title: "Benefits" description: "Catalyst provides a robust, fully-managed cache in-memory for real-time use cases to store ephemeral data in your applications." last_updated: "2026-09-02T11:24:40.077Z" source: "https://docs.catalyst.zoho.com/en/cloud-scale/help/cache/benefits/" service: "Cloud Scale" -------------------------------------------------------------------------------- ### Benefits 1. **Rapid Performance** Catalyst cache can reduce the data access time and latency, speeding up the I/O operations by a considerable amount. This increases the throughput of data transmission, and serves read and write requests with exceedingly fast response times. 2. **Auto-Scaling** Catalyst cache can auto-scale to provide the required space and resources when the load increases. It maintains the consistency of its performance and scales up the data tiers based on the application's fluctuating needs. Auto-scaling ensures that your application stays reliable, and reduces app failures significantly. 3. **Fully-Managed Backend** You can implement the Catalyst cache in your serverless application without having to directly manage or handle its architecture. This also prevents the need for you to implement the services of a cache provider in your application by yourself. This helps you avoid handling the scalability, setting up and configuring the environment, or partitioning the server to your requirements manually. Catalyst handles all the back-end functionalities of Redis, ensuring a faster application development. 4. **Fail-Safe and Automatic Failure Handling** Redis accommodates both in-memory and on-disk persistence features. The in-memory storage enables faster access of data, and the on-disk persistence ensures that the data is stored in a non-volatile memory and is available at any point of time. Catalyst also provides automatic failure handling, which helps you avoid monitoring or performing failure recovery tasks manually. 5. **Ease of Access** You can work with Catalyst cache from the Catalyst console and implement it in your application using the APIs. In the Catalyst console, you can create a cache segment, rename a segment, delete a segment, create a cache item, edit a cache item, and delete a cache item using the Catalyst console. 6. **Usage Reports** You can find reports of your Catalyst cache usage from the Catalyst console. Metrics displays the following usage information of cache: Number of Segments, Number of Keys in a Segment, Number of Keys about to Expire, and Total Size of each Segment. -------------------------------------------------------------------------------- title: "Use Cases" description: "Catalyst provides a robust, fully-managed cache in-memory for real-time use cases to store ephemeral data in your applications." last_updated: "2026-09-02T11:24:40.077Z" source: "https://docs.catalyst.zoho.com/en/cloud-scale/help/cache/use-cases/" service: "Cloud Scale" -------------------------------------------------------------------------------- ### Use Cases Catalyst cache can be used in the following scenarios: * A weather application that provides real-time information about the temperature, weather conditions, humidity levels, and more for a particular geography uses the Catalyst cache to store the weather data. This data is updated once every hour. The existing cache items are set to expire in an hour, after which new data about the latest weather conditions are obtained from a database and are written to the cache automatically. * A movie ticket booking application that allows the users to view and book movie tickets for specific theaters, which uses the Catalyst cache to store the user's session data when they initiate the process of booking tickets. This session data is set to expire in six minutes, within which the user must complete the booking process. If the user doesn't complete the booking within six minutes, the cache items are deleted, and they must initiate the booking again from scratch. Some other examples where Catalyst cache can be implemented include applications of the following types: * Real-time gaming leaderboards * Geospatial applications * IoT applications * Healthcare applications * Financial and banking applications * Mobility management applications * Telecommunications applications * E-commerce applications -------------------------------------------------------------------------------- title: "Implementation" description: "Catalyst provides a robust, fully-managed cache in-memory for real-time use cases to store ephemeral data in your applications." last_updated: "2026-09-02T11:24:40.077Z" source: "https://docs.catalyst.zoho.com/en/cloud-scale/help/cache/implementation/" service: "Cloud Scale" -------------------------------------------------------------------------------- # Implementation The implementation section acts as a step-by-step procedure guide on working with Catalyst cache from the Catalyst console. You can refer to the Java, Node.js SDK, Python SDK and the API documentation for working with cache from the respective environments. ### Create a Segment You can only create a cache segment from the Catalyst console. It cannot be done using the APIs. Note: Catalyst allows you to create up to 20 segments in a project in the development environment. The size limit of each segment is 5 MB in the development environment. You can request Catalyst for an increase in these limits by contacting our support at support@zohocatalyst.com. We will address each request on a case-by-case basis. There are no upper limits for segments in the production environment. To create a cache segment: 1. Navigate to **Cloud Scale**, and then **Cache**. 2. Click **Create Segment** in the *Segments* page. 3. Enter the segment name in the pop-up window. 4. Click **Create**. Your cache segment will now be created and listed in the *Segments* page, along with details like segment ID, created by, and created time. The default segment will already be present in the *Segments* page. ### Rename a Segment To rename a cache segment: 1. Click the ellipsis icon for the segment that needs to be renamed in the *Segments* page, and then click **Rename**. 2. Type a new name for your segment and press **Enter**. ### Create a Cache Item To create a cache item: 1. Click the name of the segment from the *Segments* page where the cache item should be created. 2. Click **Create Cache Item**. 3. Enter a keyname, value, and the expiration time in hours for the cache item. Note: * The keyname of a cache item is unique for a segment. * If you do not enter a value for the expiry time, it is automatically set to the default validity (two days). 4. Click **Create**. The cache item will be created and listed in the segment's page. You can find a particular cache item by searching using its keyname in the search bar. ### Edit a Cache Item To edit a cache item: 1. Click on the name of the segment whose cache item you want to edit, in the _Segments_ page. 2. Click on the key name and click **Edit** in the _Key Details_ window. 3. Make the necessary edits to the cache item. 4. Click **Save**. The cache item will be updated. ### Delete a Cache Item To delete a cache segment: 1. Click on the name of the segment whose cache item you want to delete, in the _Segments_ page. 2. Click on the key name and click **Delete** in the _Key Details_ window. 3. Click **Yes, Proceed** in the confirmation window. The cache item will now be deleted permanently. ### Delete a Segment To delete a cache segment: 1. Click the ellipsis icon for the segment that needs to be deleted and click **Delete**. 2. Click **Yes, Proceed** in the confirmation pop-up window. The segment will now be deleted permanently. --- ## API Reference — Cache -------------------------------------------------------------------------------- title: "Insert Key Value in Cache Segment" description: "This API enables you to insert a key-value pair as the cache item in a cache segment." last_updated: "2026-09-02T11:24:40.082Z" source: "https://docs.catalyst.zoho.com/en/api/code-reference/cloud-scale/cache/insert-key-value-in-segment/" service: "Cloud Scale" -------------------------------------------------------------------------------- # Cache Catalyst Cache is a small in-memory storage component that enables you to store data that is frequently accessed by your Catalyst application. Catalyst cache is divided into partitions or cache units called segments. Each segment stores cache items in the form of key-value pairs. # Insert a Key-Value Pair In a Cache Segment ### Description This API enables you to insert a key-value pair as the cache item in a cache segment. The segment is referred by its unique ID. The key represents the attribute and the value is the data of the cache item. You can also optionally specify the expiry time of the cache item. The default and maximum validity of a cache item is two days. Note:The cache segment must already be created. You can create a segment from the Catalyst console or use the default segment. ### Request Details #### Request URL <p>{api-domain}/baas/v1/project/{project_id}/segment/{segment_id}/cache</p> The DC-specific domain to access Catalyst API The unique ID of the project The unique ID of the cache segment #### Request Headers **Authorization:** Zoho-oauthtoken {oauth_token} <br> **Content-Type:** application/json **Optional Headers** <br> **CATALYST-ORG:** {org_id} **Environment:** Development #### Scope ZohoCatalyst.cache.CREATE #### Request JSON Properties Key name of the cache segment <br> Max Size: 50 characters Data value the key represents <br> Max Size: 16000 characters Duration of expiry in hours <br> Max Size: 48 ### Response Details The response will return the details of the cache item such as the cache_name, cache_value and expires_in, along with the details of the segment it was inserted into. curl -X POST \ https://api.catalyst.zoho.com/baas/v1/project/4000000006007/segment/3376000000425030/cache \ -H "Authorization: Zoho-oauthtoken 1000.910*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*16.2f*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*57" \ -H "Content-Type:application/json" \ -d ‘{ "cache_name":"counter", "cache_value":"125", "expiry_in_hours":24 }’ { "status": "success", "data": { "cache_name": "counter", "cache_value": "125", "project_details": { "id": 4000000006007, "project_name": "ShipmentTracking", "project_type": "Live" }, "segment_details": { "id": 3376000000425030, "segment_name": "CustomerLocation" }, "expires_in": "Mar 28, 2019 02:03 AM", "expiry_in_hours": 24, "ttl_in_milliseconds": 86400000 } } Insert Key-Value Pair- Java SDK</br></br> Insert Key-Value Pair- Node.js SDK</br></br> Insert Key-Value Pair- Python SDK </br></br> -------------------------------------------------------------------------------- title: "Get Cache Value" description: "This API enables you to retrieve the value of a cache item from a segment in the cache." last_updated: "2026-09-02T11:24:40.082Z" source: "https://docs.catalyst.zoho.com/en/api/code-reference/cloud-scale/cache/get-cache-value/" service: "Cloud Scale" -------------------------------------------------------------------------------- # Get the Value of a Cache Key ### Description This API enables you to retrieve the value of a cache item from a segment in the cache. The segment is referred by its unique segment ID, and you must pass the key of the cache item in the request. This API enables you to insert a key-value pair as the cache item in a cache segment. The segment is referred by its unique ID. The key represents the attribute and the value is the data of the cache item. You can also optionally specify the expiry time of the cache item. The default and maximum validity of a cache item is two days. ### Request Details #### Request URL <p>{api-domain}/baas/v1/project/{project_id}/segment/{segment_id}/cache?cacheKey={cache_key}</p> The DC-specific domain to access Catalyst API The unique ID of the project The unique ID of the cache segment #### Query Parameters The unique key in a segment whose value needs to be retrieved #### Request Headers **Authorization:** Zoho-oauthtoken {oauth_token} **Optional Headers** <br> **CATALYST-ORG:** {org_id} **Environment:** Development #### Scope ZohoCatalyst.cache.READ ### Response Details The response will return the details of the cache item such as the cache_name, cache_value and expires_in, along with the details of its segment. curl -X GET \ https://api.catalyst.zoho.com/baas/v1/project/4000000006007/segment/31000000006023/cache?cacheKey=counter \ -H "Authorization: Zoho-oauthtoken 1000.910*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*16.2f*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*57" { "status": "success", "data": { "cache_name": "counter", "cache_value": "1344", "project_details": { "id": 4000000006007, "project_name": "ShipmentTracking", "project_type": "Live" }, "segment_details": { "id": 31000000006023, "segment_name": "MailCounters" }, "expires_in": "2019-03-13T18:36:02+05:30", "expiry_in_hours": 3, "ttl_in_milliseconds": 81187000 } } Retrieve Data from Cache- Java SDK</br></br> Retrieve Data from Cache- Node.js SDK</br></br> Retrieve Data from Cache- Python SDK</br></br> -------------------------------------------------------------------------------- title: "Update Key Value Pair" description: "This API enables you to update a key-value pair in a cache segment." last_updated: "2026-09-02T11:24:40.083Z" source: "https://docs.catalyst.zoho.com/en/api/code-reference/cloud-scale/cache/update-key-value/" service: "Cloud Scale" -------------------------------------------------------------------------------- # Update a Key-Value Pair ### Description This API enables you to update a key-value pair in a cache segment. The segment is referred by its unique ID. The key represents the attribute and the value is the data of the cache item. You can update the key, value, or the time of expiry of the cache item. The default and maximum validity of a cache item is two days. ### Request Details #### Request URL <p>{api-domain}/baas/v1/project/{project_id}/segment/{segment_id}/cache</p> The DC-specific domain to access Catalyst API The unique ID of the project The unique ID of the cache segment #### Request Headers **Authorization:** Zoho-oauthtoken {oauth_token} **Optional Headers** <br> **CATALYST-ORG:** {org_id} **Environment:** Development #### Scope ZohoCatalyst.cache.CREATE #### Request JSON Properties Key name of the cache segment <br> Max Size: 50 characters Data value the key represents <br> Max Size: 16000 characters Duration of expiry in hours <br> Max Size: 48 ### Response Details The response will return the details of the updated cache item such as the cache_name, cache_value and expires_in, along with the details of its segment. curl -X PUT \ https://api.catalyst.zoho.com/baas/v1/project/4000000006007/segment/3376000000425030/cache \ -H "Authorization: Zoho-oauthtoken 1000.910*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*16.2f*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*57" \ -H "Content-Type:application/json" \ -d ‘{ "cache_name":"counter", "cache_value":"1472" }’ { "status": "success", "data": { "cache_name": "counter", "cache_value": "1472", "project_details": { "id": 4000000006007, "project_name": "ShipmentTracking", "project_type": "Live" }, "segment_details": { "id": 3376000000425030, "segment_name": "CounterValues" }, "expires_in": "Mar 28, 2019 02:03 AM", "expiry_in_hours": 7, "ttl_in_milliseconds": 172800000 } } Update Key-Value Pair- Java SDK</br></br> Update Key-Value Pair- Node.js SDK</br></br> Update Key-Value Pair- Python SDK</br></br> -------------------------------------------------------------------------------- title: "Delete Key Value Pair" description: "This API enables you to delete the key value of a cache item from a segment in the cache." last_updated: "2026-09-02T11:24:40.083Z" source: "https://docs.catalyst.zoho.com/en/api/code-reference/cloud-scale/cache/delete-key-value/" service: "Cloud Scale" -------------------------------------------------------------------------------- # Delete a Key-Value Pair ### Description This API enables you to delete an existing key-value pair from a specified cache segment. The segment is referred by its unique ID. The key represents the attribute and the value is the data of the cache item. ### Request Details #### Request URL <p>{api-domain}/baas/v1/project/{project_id}/segment/{segment_id}/cache?cacheKey={cache_key}</p> The DC-specific domain to access Catalyst API The unique ID of the project The unique ID of the cache segment #### Query Parameters The unique key in a segment whose value needs to be deleted. #### Request Headers **Authorization:** Zoho-oauthtoken {oauth_token} **Optional Headers** <br> **CATALYST-ORG:** {org_id} **Environment:** Development #### Scope ZohoCatalyst.cache.DELETE ### Response Details The response will return the details of the deleted cache item, including the cache_name, cache_value and expires_in. Since the cache entry has been removed, both cache_value and expiry fields will return as null. curl -X DELETE \ https://api.catalyst.zoho.com/baas/v1/project/4000000006007/segment/31000000006023/cache?cacheKey=counter \ -H "Authorization: Zoho-oauthtoken 1000.910*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*16.2f*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*57" { "status": "success", "data": { "cache_name": "NEW", "cache_value": null, "project_details": { "project_name": "ShipmentTracking", "id": 4000000006007, "project_type": "Live" }, "segment_details": { "segment_name": "MailCounters", "id": 31000000006023 }, "expires_in": null, "expiry_in_hours": null, "ttl_in_milliseconds": null } } Delete Data from Cache - Java SDK</br></br> Delete Data from Cache - Node.js SDK</br></br> Delete Data from Cache - Python SDK</br></br> --- ## SDK — Java — Cache -------------------------------------------------------------------------------- title: "Get a Segment Instance" description: "This page describes the method to get a cache segment instance in your Java application with sample code snippets." last_updated: "2026-09-02T11:24:40.119Z" source: "https://docs.catalyst.zoho.com/en/sdk/java/v1/cloud-scale/cache/get-segment-instance/" service: "Cloud Scale" related: - Cache (/en/cloud-scale/help/cache/introduction) -------------------------------------------------------------------------------- # Cache ### Get a segment instance The first step in referring to a cache segment is to create an empty segment instance using the getSegmentInstance() method which doesn't actually fire a server side call. This empty segment instance does not hold any values. #### Sample Code Snippet import com.zc.component.cache.ZCCache; import com.zc.component.cache.ZCSegment; //Get a Cache Instance ZCCache cacheobj=ZCCache.getInstance(); //Get an instance of a specific segment with segment ID ZCSegment segment = cacheobj.getSegmentInstance(1510000000054091L); -------------------------------------------------------------------------------- title: "Retrieve Data from the Cache" description: "This page describes the method to retrieve data from the cache in your Java application with sample code snippets." last_updated: "2026-09-02T11:24:40.119Z" source: "https://docs.catalyst.zoho.com/en/sdk/java/v1/cloud-scale/cache/retrieve-data-from-cache/" service: "Cloud Scale" related: - Retrieve Data from the Cache - API (/en/api/code-reference/cloud-scale/cache/get-cache-value/#GetCacheValue) - Cache (/en/cloud-scale/help/cache/introduction) -------------------------------------------------------------------------------- # Retrieve Data from Cache ### Retrieve the value by key name Every cache segment contains key-value pairs. Both keys and values are _String_ type. The value of a key is retrieved through the getCacheValue() method. #### Sample Code Snippet import com.zc.component.cache.ZCCache; import com.zc.component.cache.ZCSegment; //Get a Cache Instance ZCCache cacheobj=ZCCache.getInstance(); //Get an instance of a specific segment with segment ID ZCSegment segment = cacheobj.getSegment(1510000000054091L); //Get The value of the cache object using key String cacheValue= segment.getCacheValue("Val"); ### Retrieve the cache object by key name Another variant for retrieving a cache object is to return the corresponding value of a key as a cache object. Note: The cache object contains all of its attributes such as key, value, and expiry time. #### Sample Code Snippet import com.zc.component.cache.ZCCache; import com.zc.component.cache.ZCCacheObject; import com.zc.component.cache.ZCSegment; //Get a Cache Instance ZCCache cacheobj=ZCCache.getInstance(); //Get an instance of a specific segment with segment ID ZCSegment segment = cacheobj.getSegment(1510000000054091L); //replace segment id //Get The Cache object using key ZCCacheObject cacheValue = segment.getCacheObject("Name"); // replace cache key -------------------------------------------------------------------------------- title: "Insert Data into Cache" description: "This page describes the method to insert data into the cache in your Java application with sample code snippets." last_updated: "2026-09-02T11:24:40.119Z" source: "https://docs.catalyst.zoho.com/en/sdk/java/v1/cloud-scale/cache/insert-data-into-cache/" service: "Cloud Scale" related: - Insert Data into the Cache - API (/en/api/code-reference/cloud-scale/cache/insert-key-value-in-segment/#InsertKey-ValueinCacheSegment) - Cache (/en/cloud-scale/help/cache/introduction) -------------------------------------------------------------------------------- # Insert data into the cache In addition to retrieving cache information, the following putCache() variants also support inserting cache object elements. ### Insert a key-value pair The following code inserts a key-value pair to a cache segment through putCacheValue() method. Note: The expiry time is set to 48 hours by default. #### Sample Code Snippet import com.zc.component.cache.ZCCache; import com.zc.component.cache.ZCCacheObject; import com.zc.component.cache.ZCSegment; //Get a Cache Instance ZCCache cacheobj=ZCCache.getInstance(); //Get an instance of a specific segment with segment ID ZCSegment segment = cacheobj.getSegment(1510000000054091L); //Put Value in Cache as key-value pair (with a default Expiry Time of 48 hours) ZCCacheObject cache = segment.putCacheValue("Name", "Amelia Burrows"); ### Insert a key-value pair with an expiry time Similar to the previous case, along with key and value parameters, the optional parameter expiry time is used in this variant. Note: The value of the expiry time must be passed as a long value in hours. #### Sample Code Snippet import com.zc.component.cache.ZCCache; import com.zc.component.cache.ZCCacheObject; import com.zc.component.cache.ZCSegment; //Get a Cache Instance ZCCache cacheobj=ZCCache.getInstance(); //Get an instance of a specific segment with segment ID ZCSegment segment = cacheobj.getSegment(1510000000054091L); //Put Value in Cache as key-value pair with specified expiry time. (Time in hours) ZCCacheObject cache = segment.putCacheValue("LastName", "S", 1L); ### Insert a key-value pair through a cache object The following code inserts a key-value pair to a cache segment through putCacheObject() method. Note: If the key name already exists in a cache segment, it will be replaced with the new value inserted. #### Sample Code Snippet import com.zc.component.cache.ZCCache; import com.zc.component.cache.ZCCacheObject; import com.zc.component.cache.ZCSegment; //Get a Cache Instance ZCCache cacheobj=ZCCache.getInstance(); //Get an instance of a specific segment with segment ID ZCSegment segment = cacheobj.getSegment(1510000000054091L); //Create a CacheObject and set cache segment attributes ZCCacheObject cacheDetails = ZCCacheObject.getInstance(); cacheDetails.setKeyName("ObjectKey"); cacheDetails.setValue("ObjectValue"); cacheDetails.setExpiryInHours(1L); //Create the cache using the CacheObject ZCCacheObject cache = segment.putCacheObject(cacheDetails); -------------------------------------------------------------------------------- title: "Update Data in Cache" description: "This page describes the method to update data in the cache in your Java application with sample code snippets." last_updated: "2026-09-02T11:24:40.120Z" source: "https://docs.catalyst.zoho.com/en/sdk/java/v1/cloud-scale/cache/update-data-in-cache/" service: "Cloud Scale" related: - Update Data in Cache - API (/en/api/code-reference/cloud-scale/cache/update-key-value/#UpdateKey-ValuePair) - Cache (/en/cloud-scale/help/cache/introduction) -------------------------------------------------------------------------------- # Update Data in Cache Existing data from the cache can be updated through updateCacheValue() method.It comes with the following two variants, ### Update cache value of a key This variant updates the value of the existing key, by passing the updated value as parameter to the updateCacheValue() method. The expiry time of the key is maintained as its previous value. #### Sample Code Snippet import com.zc.component.cache.ZCCache; import com.zc.component.cache.ZCSegment; //Get a Cache Instance ZCCache cacheobj=ZCCache.getInstance(); //Get an instance of a specific segment with a segment ID ZCSegment segment = cacheobj.getSegment(1510000000054091L); //replace segment id // Updates the value of the existing cache’s key ZCCache.getInstance().updateCacheValue("time_taken", "10"); ### Update cache value with expiry time Similar to the above one, this variant updates the value of the key, where the expiry time of the key is also passed as the parameter to the method. The value of the expiry time is updated with the new value passed as a long int value in hours. #### Sample Code Snippet import com.zc.component.cache.ZCCache; import com.zc.component.cache.ZCSegment; //Get a Cache Instance ZCCache cacheobj=ZCCache.getInstance(); //Get an instance of a specific segment with a segment ID ZCSegment segment = cacheobj.getSegment(151xxxxxxxxxL); //Update the value of the existing cache’s key with its expiry time ZCCache.getInstance().updateCacheValue("time_taken", "48", 2L); -------------------------------------------------------------------------------- title: "Delete a Key-Value Pair" description: "This page describes the method to delete a key-value pair using a key or cache object in your Java application with sample code snippets." last_updated: "2026-09-02T11:24:40.120Z" source: "https://docs.catalyst.zoho.com/en/sdk/java/v1/cloud-scale/cache/delete-key-value-pair/" service: "Cloud Scale" related: - Cache (/en/cloud-scale/help/cache/introduction) -------------------------------------------------------------------------------- # Delete a key-value pair When a key-value pair is no longer needed, it can be permanently deleted from the cache segment. The key-value pair cannot be restored once it is deleted,but it can be recreated. ### Delete using a key You can delete a key by passing it directly to the deleteCacheValue() method as a parameter. #### Sample Code Snippet import com.zc.component.cache.ZCCache; import com.zc.component.cache.ZCSegment; //Get a Cache Instance ZCCache cacheobj=ZCCache.getInstance(); //Get an instance of a specific segment with segment ID ZCSegment segment = cacheobj.getSegment(1510000000054091L); //Delete the Cache object using key segment.deleteCacheValue("Name"); ### Delete using a cache object In this delete variant, an empty cache instance is constructed and the key value is set to it. This instance is passed as an argument to the deleteCacheObject() method. #### Sample Code Snippet import com.zc.component.cache.ZCCache; import com.zc.component.cache.ZCCacheObject; import com.zc.component.cache.ZCSegment; //Get a Cache Instance ZCCache cacheobj=ZCCache.getInstance(); //Get an instance of a specific segment with segment ID ZCSegment segment = cacheobj.getSegment(1510000000054091L); //Create a CacheObject and set cache details ZCCacheObject cacheDetails = ZCCacheObject.getInstance(); cacheDetails.setKeyName("ObjectKey"); //Delete the cache using the CacheObject segment.deleteCacheObject(cacheDetails); --- ## SDK — Modular JavaScript SDK — Cache -------------------------------------------------------------------------------- title: "Overview" description: "This page describes the method to perform operations in the Cache component." last_updated: "2026-09-02T11:24:40.121Z" source: "https://docs.catalyst.zoho.com/en/sdk/javascript/v1/cloudscale/cache/overview/" service: "CloudScale" related: - Catalyst CloudScale (/en/cloud-scale/) - Cache Help Documentation (/en/cloud-scale/help/cache/introduction/) - Java SDK Documentation (/en/sdk/java/v1/cloud-scale/cache/get-segment-instance/) - NodeJS SDK Documentation (/en/sdk/nodejs/v2/cloud-scale/cache/get-component-instance/) - Python SDK Documentation (/en/sdk/python/v1/cloud-scale/cache/get-component-instance/) - REST API Documentation (/en/api/code-reference/cloud-scale/cache/insert-key-value-in-segment/#InsertKeyValueinCacheSegment) -------------------------------------------------------------------------------- # Cache JavaScript SDK # Overview Cache is a *CloudScale* component, that can expertly handler small storage of data to facilitate retrieval of actively used data. Cache is best suited to handle your applications ephemera data or frequently accessed information. Cache actively reduces load on primary databases in memory-intensive real-time applications or microservices that demand sub-millisecond responses. Catalyst Cache is divided into cache units called segments. Each segment holds cache items (data) in the form of JSON key value pairs. The key and value are of the String data type. The **Cache JavaScript SDK** package enables you to perform CRUD operations on the data stored in Cache. You can retrieve data, insert data, update and delete data from the Cache component through code. ### Prerequisites You need to install the following package to use the Cache SDK methods. npm install @zcatalyst/cache Info: Ensure that you have applied the required authentication configuration to use the SDK methods of this component. ### Import Requirement You will need to import the following module to use the Cache SDK methods. const { Cache } = require('@zcatalyst/cache'); ### List of SDK Methods The following table contains the list of SDK methods that can be used to perform operations in Cache through code. <table border="1" cellpadding="8" cellspacing="0"> <thead> <tr> <th>Category</th> <th>SDK Method</th> <th>Required Scope</th> </tr> </thead> <tbody> <tr> <td>General Operations</td> <td> <ul> <li>Get a Cache Instance</li> <li>Get a Segment Instance</li> </ul> </td> <td>No requirement</td> </tr> <tr> <td>Cache Operations</td> <td> <ul> <li>Retrieve data from Cache</li> <li>Insert data to Cache</li> <li>Update data in Cache</li> <li>Delete Cache Item</li> </ul> </td> <td>Admin</td> </tr> </tbody> </table> -------------------------------------------------------------------------------- title: "Get a Cache Instance" description: "This page describes the method to perform operations in the Cache component." last_updated: "2026-09-02T11:24:40.121Z" source: "https://docs.catalyst.zoho.com/en/sdk/javascript/v1/cloudscale/cache/get-cache-instance/" service: "CloudScale" related: - Catalyst CloudScale (/en/cloud-scale/) - Cache Help Documentation (/en/cloud-scale/help/cache/introduction/) - Java SDK Documentation (/en/sdk/java/v1/cloud-scale/cache/get-segment-instance/) - NodeJS SDK Documentation (/en/sdk/nodejs/v2/cloud-scale/cache/get-component-instance/) - Python SDK Documentation (/en/sdk/python/v1/cloud-scale/cache/get-component-instance/) - REST API Documentation (/en/api/code-reference/cloud-scale/cache/insert-key-value-in-segment/#InsertKeyValueinCacheSegment) -------------------------------------------------------------------------------- # Get a Cache Instance Note: Ensure you have installed the required package to use this SDK method. You can get the cache component reference as shown below. This will not fire a server-side call. You will refer to this component instance in various code snippets of working with Cache. const cache = new Cache(); -------------------------------------------------------------------------------- title: "Get a Segment Instance" description: "This page describes the method to perform operations in the Cache component." last_updated: "2026-09-02T11:24:40.121Z" source: "https://docs.catalyst.zoho.com/en/sdk/javascript/v1/cloudscale/cache/get-segment-instance/" service: "CloudScale" related: - Catalyst CloudScale (/en/cloud-scale/) - Cache Help Documentation (/en/cloud-scale/help/cache/introduction/) - Java SDK Documentation (/en/sdk/java/v1/cloud-scale/cache/get-segment-instance/) - NodeJS SDK Documentation (/en/sdk/nodejs/v2/cloud-scale/cache/get-segment-instance/) - Python SDK Documentation (/en/sdk/python/v1/cloud-scale/cache/get-segment-instance/) - REST API Documentation (/en/api/code-reference/cloud-scale/cache/insert-key-value-in-segment/#InsertKeyValueinCacheSegment) -------------------------------------------------------------------------------- # Get a Segment Instance Note: Ensure you have installed the required package to use this SDK method. A segment reference can be created using the following method which does not fire a server-side call. The cache reference used in the code snippet below is the component instance. Note: If you wish to get the instance of a particular segment, then you need to pass the segment ID as the parameter. If you don’t provide any segment ID, it will refer to the default segment. // Refer a Cache segment through the Segment ID const cache = new Cache(); const segment = cache.segment();// Since no ID is passed here, it will refer to the default segment -------------------------------------------------------------------------------- title: "Retrieve Data from the Cache" description: "This page describes the method to perform operations in the Cache component." last_updated: "2026-09-02T11:24:40.121Z" source: "https://docs.catalyst.zoho.com/en/sdk/javascript/v1/cloudscale/cache/retreive-data/" service: "CloudScale" related: - Catalyst CloudScale (/en/cloud-scale/) - Cache Help Documentation (/en/cloud-scale/help/cache/introduction/) - Java SDK Documentation (/en/sdk/java/v1/cloud-scale/cache/retrieve-data-from-cache/) - NodeJS SDK Documentation (/en/sdk/nodejs/v2/cloud-scale/cache/retrieve-data-from-cache/) - Python SDK Documentation (/en/sdk/python/v1/cloud-scale/cache/retrieve-data-from-cache/) - REST API Documentation (/en/api/code-reference/cloud-scale/cache/insert-key-value-in-segment/#InsertKeyValueinCacheSegment) -------------------------------------------------------------------------------- # Retrieve Data from the Cache Note: Ensure you have installed the required package to use this SDK method. ### Get Cache Value Using the getValue() SDK method, you can retrieve the value of a Cache item from a segment. You must pass the key name as the argument. The promise returned here will be resolved to a String, which is the actual value of the key. The segment reference used in the code snippet below is the segment instance. //Get cache value by passing the key name const cache = new Cache(); const segment = cache.segment(); const entity = await segment.getValue('Age'); console.log(entity); ### Get Cache Object You can retrieve the details of the cache where the key-value pair is of the object type. The key object is retrieved using the get() method where the key name is passed as an argument. The promise returned from this code will be resolved to an object which is a JSON. The segment reference used in the code snippet below is the segment instance. //Get Cache object by passing the key name as argument const cache = new Cache(); const segment = cache.segment(); const entity = await segment.get('Age'); console.log(entity); #### Example of Expected Response { "cache_name": "Name", "cache_value": "Amelia Burrows", "project_details": { "project_name": "AlienCity", "id": "2136000000007733" }, "segment_details": { "segment_name": "DataStore", "id": "2136000000008572" }, "expires_in": "Aug 18, 2021 06:39 PM", "expiry_in_hours": "47", "ttl_in_milliseconds": "172727000" } -------------------------------------------------------------------------------- title: "Insert Data in Cache" description: "This page describes the method to perform operations in the Cache component." last_updated: "2026-09-02T11:24:40.122Z" source: "https://docs.catalyst.zoho.com/en/sdk/javascript/v1/cloudscale/cache/insert-data/" service: "CloudScale" related: - Catalyst CloudScale (/en/cloud-scale/) - Cache Help Documentation (/en/cloud-scale/help/cache/introduction/) - Java SDK Documentation (/en/sdk/java/v1/cloud-scale/cache/insert-data-into-cache/) - NodeJS SDK Documentation (/en/sdk/nodejs/v2/cloud-scale/cache/insert-data-into-cache/) - Python SDK Documentation (/en/sdk/python/v1/cloud-scale/cache/insert-data-into-cache/) - REST API Documentation (/en/api/code-reference/cloud-scale/cache/insert-key-value-in-segment/#InsertKeyValueinCacheSegment) -------------------------------------------------------------------------------- # Insert Data in Cache Note: Ensure you have installed the required package to use this SDK method. Using the put() SDK method, you can insert a cache item. You can insert a key-value pair in an existing cache segment in your Catalyst project. The key name and key value are of the **String** type and are passed as arguments to the method. The promise returned here will be resolved to a JSON object. You can also pass the *expiry time* for the cache item optionally. If you do not pass that value, the expiration time will be set to **48 hours** by default. The segment reference used in the code snippet below is the segment instance. //Insert Cache by passing the key-value pair const cache = new Cache(); const segment = cache.segment(); const entity = await segment.put('Name', 'Linda McCartney',1); //Expiry time for cache in hours console.log(entity); #### Example of Expected Response { "cache_name": "Last_Name", "cache_value": "Smith", "project_details": { "project_name": "AlienCity", "id": "2136000000007733" }, "segment_details": { "segment_name": "DataStore", "id": "2136000000008572" }, "expires_in": "Aug 18, 2021 06:46 PM", "expiry_in_hours": "48", "ttl_in_milliseconds": "172800000" } -------------------------------------------------------------------------------- title: "Update Data in Cache" description: "This page describes the method to perform operations in the Cache component." last_updated: "2026-09-02T11:24:40.122Z" source: "https://docs.catalyst.zoho.com/en/sdk/javascript/v1/cloudscale/cache/update-cache/" service: "CloudScale" related: - Catalyst CloudScale (/en/cloud-scale/) - Cache Help Documentation (/en/cloud-scale/help/cache/introduction/) - Java SDK Documentation (/en/sdk/java/v1/cloud-scale/cache/update-data-in-cache/) - NodeJS SDK Documentation (/en/sdk/nodejs/v2/cloud-scale/cache/update-data-in-cache/) - Python SDK Documentation (/en/sdk/python/v1/cloud-scale/cache/update-data-in-cache/) - REST API Documentation (/en/api/code-reference/cloud-scale/cache/insert-key-value-in-segment/#InsertKeyValueinCacheSegment) -------------------------------------------------------------------------------- # Update Data in Cache Note: Ensure you have installed the required package to use this SDK method. You can update the key-value pair in a cache segment using the update() SDK method. You must pass the key name and key-value which are of the *String* type as arguments. If the values aren’t present, they will be inserted into the cache segment. The promise returned here will be resolved to a JSON object. You can also optionally pass the **expiry time** parameter. If you don’t assign a value for that, the expiry time will be set to **48 hours** by default. The segment reference used in the code snippet below is the segment instance. //Update cache by passing the key-value pair const cache = new Cache(); const segment = cache.segment(); const entity = await segment.update('Name', 'Micheal Greene'); console.log(entity); #### Example of Expected Response A sample response that you will receive for each version is shown below. { "cache_name": "Last_Name", "cache_value": "Brown", "project_details": { "project_name": "AlienCity", "id": "2136000000007733" }, "segment_details": { "segment_name": "DataStore", "id": "2136000000008572" }, "expires_in": "Aug 18, 2021 06:46 PM", "expiry_in_hours": "47", "ttl_in_milliseconds": "172596000" } -------------------------------------------------------------------------------- title: "Delete Cache Item" description: "This page describes the method to perform operations in the Cache component." last_updated: "2026-09-02T11:24:40.122Z" source: "https://docs.catalyst.zoho.com/en/sdk/javascript/v1/cloudscale/cache/delete-cache/" service: "CloudScale" related: - Catalyst CloudScale (/en/cloud-scale/) - Cache Help Documentation (/en/cloud-scale/help/cache/introduction/) - Java SDK Documentation (/en/sdk/java/v1/cloud-scale/cache/delete-key-value-pair/) - NodeJS SDK Documentation (/en/sdk/nodejs/v2/cloud-scale/cache/delete-key-value-pair/) - Python SDK Documentation (/en/sdk/python/v1/cloud-scale/cache/delete-key-value-pair/) - REST API Documentation (/en/api/code-reference/cloud-scale/cache/insert-key-value-in-segment/#InsertKeyValueinCacheSegment) -------------------------------------------------------------------------------- # Delete Cache Item Note: Ensure you have installed the required package to use this SDK method. Using the delete() SDK method, a cache item can be permanently deleted from the cache segment, when it is no longer required. The cache item (data key-value pair) cannot be restored once it is deleted, but it can be recreated. The segment reference used in the code snippet below is the segment instance. #### Delete Cache Item Using a Key You can delete a key by passing it directly as a parameter to the delete() method. The promise returned here will be resolved to an object which is a JSON. // delete Cache using delete by passing the key name const cache = new Cache(); const segment = cache.segment(); const entity = await segment.delete('Name'); console.log(entity); --- ## SDK — Node JS — Cache -------------------------------------------------------------------------------- title: "Get component instance" description: "This page describes the method to delete a key-value pair using a key or cache object in your NodeJS application with sample code snippets." last_updated: "2026-09-02T11:24:40.123Z" source: "https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/cloud-scale/cache/get-component-instance/" service: "Cloud Scale" related: - Cache (/en/cloud-scale/help/cache/introduction) -------------------------------------------------------------------------------- # Get component instance The cache reference can be created using the following method which does not fire a server-side call. //Get a cache instance let cache = app.cache(); -------------------------------------------------------------------------------- title: "Get segment instance" description: "This page describes the method to get a cache segment instance in your NodeJS application with sample code snippets." last_updated: "2026-09-02T11:24:40.123Z" source: "https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/cloud-scale/cache/get-segment-instance/" service: "Cloud Scale" related: - Cache (/en/cloud-scale/help/cache/introduction) -------------------------------------------------------------------------------- # Get a segment instance A segment reference can be created using the following method which does not fire a server-side call. The cache reference used in the code snippet below is the component instance. When you pass the segment id in the parameter, it will refer to the particular segment. When you don't provide any segment id, it will refer to the default segment. //Refer a cache segment through the segment ID let cache = app.cache(); let segment = cache.segment(); -------------------------------------------------------------------------------- title: "Retrieve data from the cache" description: "This page describes the method to retrieve data from the cache in your NodeJS application with sample code snippets." last_updated: "2026-09-02T11:24:40.123Z" source: "https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/cloud-scale/cache/retrieve-data-from-cache/" service: "Cloud Scale" related: - Retrieve data from the cache - API (/en/api/code-reference/cloud-scale/cache/get-cache-value/#GetCacheValue) - Cache (/en/cloud-scale/help/cache/introduction) -------------------------------------------------------------------------------- # Retrieve data from the cache ### Get Cache Value Catalyst cache is divided into partitions or cache units called segments. Each segment stores cache items in the form of key-value pairs. Both keys and values are of the String type. You can retrieve the value of a cache item from a segment in the cache using the getValue() method. You must pass the key name as the argument. The promise returned here will be resolved to a String, which is the actual value of the key. The segment reference used in the code snippet below is the segment instance created earlier. //Get cache value by passing the key name let cache = app.cache(); let segment = cache.segment(); let cachePromise = segment.getValue('Age'); cachePromise.then((entity) => { console.log(entity); }); ### Get Cache Object You can retrieve the details of the cache where the key-value pair is of the object type. The key object is retrieved using the _get()_ method where the key name is passed as an argument. The _segment_ reference used in the code snippet below is a segment instance. The promise returned here will be resolved to an object which is a JSON. //Get Cache object by passing the key name as argument let cache = app.cache(); let segment = cache.segment(); let cachePromise = segment.get('Age'); cachePromise.then((entity) => { console.log(entity); }); A sample response that you will receive for each version is shown below: { cache_name: "Name", cache_value: "Amelia Burrows", project_details: { project_name: "AlienCity", id: "2136000000007733" }, segment_details: { segment_name: "DataStore", id: "2136000000008572" }, expires_in: "Aug 18, 2021 06:39 PM", expiry_in_hours: "47", ttl_in_milliseconds: "172727000" } { cache_name: "Name", cache_value: "Amelia Burrows", project_details: { project_name: "AlienCity", id: 2136000000007733 }, segment_details: { segment_name: "DataStore", id: 2136000000008572 }, expires_in: "Aug 18, 2021 06:39 PM", expiry_in_hours: 47, ttl_in_milliseconds: 172609000 } -------------------------------------------------------------------------------- title: "Insert data to cache" description: "This page describes the method to insert data into the cache in your NodeJS application with sample code snippets." last_updated: "2026-09-02T11:24:40.124Z" source: "https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/cloud-scale/cache/insert-data-into-cache/" service: "Cloud Scale" related: - Insert data to cache - API (/en/api/code-reference/cloud-scale/cache/insert-key-value-in-segment/#InsertKeyValueinCacheSegment) - Cache (/en/cloud-scale/help/cache/introduction) -------------------------------------------------------------------------------- # Insert Data in Cache You can insert a cache element using the put() method. This enables you to insert a key-value pair in an existing cache segment in your Catalyst project. The key name and key value are of the String type and are passed as arguments to the method. You can also pass the expiry time for the cache element optionally. If you do not pass that value, the expiry time will be set to 48 hours by default. The segment reference used in the code snippet below is the segment instance created earlier. The promise returned here will be resolved to a JSON object. //Insert Cache by passing the key-value pair let cache = app.cache(); let segment = cache.segment(); let cachePromise = segment.put('Name', 'Linda McCartney',1); //Expiry time for cache in hours cachePromise.then((entity) => { console.log(entity); }); A sample response that you will receive for each version is shown below: { cache_name: "Last_Name", cache_value: "Smith", project_details: { project_name: "AlienCity", id: "2136000000007733" }, segment_details: { segment_name: "DataStore", id: "2136000000008572" }, expires_in: "Aug 18, 2021 06:46 PM", expiry_in_hours: "48", ttl_in_milliseconds: "172800000" } { cache_name: "Last_Name", cache_value: "Smith", project_details: { project_name: "AlienCity", id: 2136000000007733 }, segment_details: { segment_name: "DataStore", id: 2136000000008572 }, expires_in: "Aug 18, 2021 06:45 PM", expiry_in_hours: 48, ttl_in_milliseconds: 172800000 } -------------------------------------------------------------------------------- title: "Update Data in Cache" description: "This page describes the method to update data in the cache in your Java application with sample code snippets." last_updated: "2026-09-02T11:24:40.124Z" source: "https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/cloud-scale/cache/update-data-in-cache/" service: "Cloud Scale" related: - Update Data in Cache - API (/en/api/code-reference/cloud-scale/cache/update-key-value/#UpdateKey-ValuePair) - Cache (/en/cloud-scale/help/cache/introduction) -------------------------------------------------------------------------------- # Update Data in Cache You can update the key-value pair in a cache segment using the update() method. You must pass the key name and key-value which are of the String type as arguments. If the values aren't present, they will be inserted into the cache segment. The promise returned here will be resolved to a JSON object. You can also optionally pass the expiry time parameter. If you don't assign a value for that, the expiry time will be set to 48 hours by default. The segment reference used in the code snippet below is the segment instance created earlier. //Update cache by passing the key-value pair let cache = app.cache(); let segment = cache.segment(); let cachePromise = segment.update('Name', 'Micheal Greene'); cachePromise.then((entity) => { console.log(entity); }); A sample response that you will receive for each version is shown below: { cache_name: "Last_Name", cache_value: "Brown", project_details: { project_name: "AlienCity", id: "2136000000007733" }, segment_details: { segment_name: "DataStore", id: "2136000000008572" }, expires_in: "Aug 18, 2021 06:46 PM", expiry_in_hours: "47", ttl_in_milliseconds: "172596000" } { cache_name: "Last_Name", cache_value: "Brown", project_details: { project_name: "AlienCity", id: 2136000000007733 }, segment_details: { segment_name: "DataStore", id: 2136000000008572 }, expires_in: "Aug 18, 2021 06:46 PM", expiry_in_hours: 47, ttl_in_milliseconds: 172511000 } -------------------------------------------------------------------------------- title: "Delete key value pair" description: "This page describes the method to delete a key-value pair using a key or cache object in your NodeJS application with sample code snippets." last_updated: "2026-09-02T11:24:40.124Z" source: "https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/cloud-scale/cache/delete-key-value-pair/" service: "Cloud Scale" related: - Cache (/en/cloud-scale/help/cache/introduction) -------------------------------------------------------------------------------- # Delete a key-value pair If a key-value pair is no longer needed, it can be permanently deleted from the cache segment. The key-value pair cannot be restored once it is deleted, but it can be recreated. The _segment_ reference used in the code snippet below is a segment instance. ### Delete using a key You can delete a key by passing it directly as a parameter to the _delete()_ method. The promise returned here will be resolved to an object which is a JSON. //delete Cache using delete by passing the key name let cache = app.cache(); let segment = cache.segment(); let deletePromise = segment.delete('Name'); deletePromise.then((entity) => { console.log(entity); }); --- ## SDK — Python — Cache -------------------------------------------------------------------------------- title: "Get Cache Instance" description: "This page describes the method to delete a key-value pair using a key or cache object in your Python application with sample code snippets." last_updated: "2026-09-02T11:24:40.125Z" source: "https://docs.catalyst.zoho.com/en/sdk/python/v1/cloud-scale/cache/get-component-instance/" service: "Cloud Scale" related: - Cache Help (/en/cloud-scale/help/cache/introduction) - SDK Scopes (/en/sdk/python/v1/sdk-scopes) -------------------------------------------------------------------------------- # Cache Catalyst Cloud Scale Cache is provided as an ephemeral storage component that can be used independently of your main data storage unit. It is highly useful when implemented in dynamic, memory-intensive applications. Catalyst cache can be implemented in your application using the SDK methods listed below. # Get component instance A component instance is an object that can be used to access the pre-defined configurations specific to a particular component. This process will not fire a server-side call. The app reference used in the code below is the Python object returned as a response during SDK initialization. You can create a new cache_serviceinstance as shown below. This instance will be used in multiple scenarios while performing cache component related operations. #Get cache component instance cache_service = app.cache() -------------------------------------------------------------------------------- title: "Get Segment Instance" description: "This page describes the method to get a cache segment instance in your Python application with sample code snippets." last_updated: "2026-09-02T11:24:40.125Z" source: "https://docs.catalyst.zoho.com/en/sdk/python/v1/cloud-scale/cache/get-segment-instance/" service: "Cloud Scale" related: - Cache Help (/en/cloud-scale/help/cache/introduction) - SDK Scopes (/en/sdk/python/v1/sdk-scopes) -------------------------------------------------------------------------------- # Get a segment instance To know more about the component instance cache_service used below, please refer to this section. When the segment ID is passed as a parameter, the cache implementation will refer to that particular segment. When the segment ID is not specified explicitly, then it will refer to the default segment. #Get segment instance cache_service = app.cache() segment_service = cache_service.segment() -------------------------------------------------------------------------------- title: "Retrieve Data from the Cache" description: "This page describes the method to retrieve data from the cache in your Python application with sample code snippets." last_updated: "2026-09-02T11:24:40.125Z" source: "https://docs.catalyst.zoho.com/en/sdk/python/v1/cloud-scale/cache/retrieve-data-from-cache/" service: "Cloud Scale" related: - Retrieve Data from the Cache - API (/en/api/code-reference/cloud-scale/cache/get-cache-value/#GetCacheValue) - Cache Help (/en/cloud-scale/help/cache/introduction) - SDK Scopes (/en/sdk/python/v1/sdk-scopes) -------------------------------------------------------------------------------- # Retrieve data from the cache ### Get Cache Value Catalyst Cloud Scale Cache is divided into partitions or cache units called segments. Each segment stores cache items in the form of key-value pairs. Both keys and values are of type String. You can retrieve the value of a cache item from a segment in the cache using the get_value() method. You must pass the key name as the argument and the value corresponding to that key will be returned as a response. To know more about the component instance cache_service and the segment_service segment_service used below, please refer to their respective help sections. **Parameters Used** <table class="content-table"> <thead> <tr> <th class="w20p">Parameter Name</th> <th class="w20p">Data Type</th> <th class="w60p">Definition</th> </tr> </thead> <tbody> <tr> <td>Key</td> <td>String</td> <td>A Mandatory parameter. Will hold the key for retrieving the cache value.</td> </tr> </tbody> </table> #Get cache value cache_service = app.cache() segment_service = cache_service.segment() data = segment_service.get_value('key') A sample response is shown below : { "cache_name": "Name", "cache_value": "Amelia Burrows", "expires_in": "Mar 09, 2023 06:20 PM", "expiry_in_hours": "48", "project_details": { "id": "2648000001343001", "project_name": "appEngine", "project_type": "Live", }, "segment_details": {"id": "2648000001343037", "segment_name": "Default"}, "ttl_in_milliseconds": "172800000", } ### Get Cache Object You can retrieve the details of the cache where the key-value pair is of type dictionary. The key object is retrieved using the get() method, where the key name is passed as an argument. To know more about the component instance cache_service and the segment instance segment_service used below, please refer to their respective help sections. **Parameters Used** <table class="content-table"> <thead> <tr> <th class="w20p">Parameter Name</th> <th class="w20p">Data Type</th> <th class="w60p">Definition</th> </tr> </thead> <tbody> <tr> <td>cache_name</td> <td>String</td> <td>A Mandatory parameter. Will hold the key for retrieving the cache object.</td> </tr> </tbody> </table> cache_service = app.cache() segment_service = cache_service.segment() data = segment_service.get('key') A sample response is shown below : { cache_name: "Name", cache_value: "Amelia Burrows", project_details: { project_name: "AlienCity", id: "2136000000007733" }, segment_details: { segment_name: "Location", id: "2136000000008572" }, expires_in: "Aug 18, 2021 06:39 PM", expiry_in_hours: "47", ttl_in_milliseconds: "172727000" } Info : Refer to the SDK Scopes table to determine the required permission level for performing the above operation. -------------------------------------------------------------------------------- title: "Insert Data to Cache" description: "This page describes the method to insert data into the cache in your Python application with sample code snippets." last_updated: "2026-09-02T11:24:40.125Z" source: "https://docs.catalyst.zoho.com/en/sdk/python/v1/cloud-scale/cache/insert-data-into-cache/" service: "Cloud Scale" related: - Insert Data to Cache - API (/en/api/code-reference/cloud-scale/cache/insert-key-value-in-segment/#InsertKey-ValueinCacheSegment) - Cache Help (/en/cloud-scale/help/cache/introduction) - SDK Scopes (/en/sdk/python/v1/sdk-scopes) -------------------------------------------------------------------------------- # Insert Data in Cache You can insert a cache element using the put() method. This enables you to insert a key-value pair in an existing cache segment in your Catalyst project. The key name and key value are of type String and are passed as arguments to the method. You can also optionally pass the expiry time parameter. The expiration time will be set to 48 hours by default if the value is not specified explicitly. To know more about the component instance cache_service and the segment instance segment_service used below, please refer to their respective help sections. **Parameters Used** <table class="content-table"> <thead> <tr> <th class="w20p">Parameter Name</th> <th class="w20p">Data Type</th> <th class="w60p">Definition</th> </tr> </thead> <tbody> <tr> <td>cache_name</td> <td>String</td> <td>A Mandatory parameter. Will hold the key to be inserted in the cache.</td> </tr> <tr> <td>cache_value</td> <td>String</td> <td>A Mandatory parameter. Will hold the value to be inserted in the cache.</td> </tr> <tr> <td>expiry_in_hours</td> <td>Numeric</td> <td>A Optional parameter. Will hold the value of the expiry time of the data.</td> </tr> </tbody> </table> # Insert Data to Cache cache_service = app.cache() segment_service = cache_service.segment() segment_service.put('Name', 'Smith',2) A sample response is shown below : { cache_name: "Name", cache_value: "Smith", project_details: { project_name: "AlienCity", id: "2136000000007733" }, segment_details: { segment_name: "Location", id: "1234324234" }, expires_in: "Aug 18, 2021 06:46 PM", expiry_in_hours: "2", ttl_in_milliseconds: "172800000" } Info : Refer to the SDK Scopes table to determine the required permission level for performing the above operation. -------------------------------------------------------------------------------- title: "Update Data in Cache" description: "This page describes the method to update data in the cache in your Python application with sample code snippets." last_updated: "2026-09-02T11:24:40.126Z" source: "https://docs.catalyst.zoho.com/en/sdk/python/v1/cloud-scale/cache/update-data-in-cache/" service: "Cloud Scale" related: - Update Data in Cache - API (/en/api/code-reference/cloud-scale/cache/update-key-value/#UpdateKey-ValuePair) - Cache Help (/en/cloud-scale/help/cache/introduction) - SDK Scopes (/en/sdk/python/v1/sdk-scopes) -------------------------------------------------------------------------------- # Update Data in Cache You can update the key-value pair in a cache segment using the update() method. You must pass the key name and key-value which are of the String type as arguments. If the values aren't present, they will be inserted into the cache segment. You can also optionally pass the expiry time parameter. The expiration time will be set to 48 hours by default if the value is not specified explicitly. To know more about the component instance cache_service and the segment instancesegment_service used below, please refer to their respective help sections. **Parameters Used** <table class="content-table"> <thead> <tr> <th class="w20p">Parameter Name</th> <th class="w20p">Data Type</th> <th class="w60p">Definition</th> </tr> </thead> <tbody> <tr> <td>cache_name</td> <td>String</td> <td>A Mandatory parameter. Will hold the key to be updated in the cache.</td> </tr> <tr> <td>cache_value</td> <td>String</td> <td>A Mandatory parameter. Will hold the value of the key that has to be updated in the cache.</td> </tr> </tbody> </table> #Update data in cache cache_service = app.cache() segment_service = cache_service.segment() segment_service.update('Name', 'Michael Scott') A sample response is shown below : { cache_name: "Name", cache_value: "Michael Scott", project_details: { project_name: "AlienCity", id: "2136000000007733" }, segment_details: { segment_name: "Data Store", id: "2136000000008572" }, expires_in: "Aug 18, 2021 06:46 PM", expiry_in_hours: "47", ttl_in_milliseconds: "172596000" } Info : Refer to the SDK Scopes table to determine the required permission level for performing the above operation. -------------------------------------------------------------------------------- title: "Delete Key Value Pair" description: "This page describes the method to delete a key-value pair using a key or cache object in your Python application with sample code snippets." last_updated: "2026-09-02T11:24:40.126Z" source: "https://docs.catalyst.zoho.com/en/sdk/python/v1/cloud-scale/cache/delete-key-value-pair/" service: "Cloud Scale" related: - Cache Help (/en/cloud-scale/help/cache/introduction) - SDK Scopes (/en/sdk/python/v1/sdk-scopes) -------------------------------------------------------------------------------- # Delete a Key-Value Pair If a key-value pair is no longer needed, it can be permanently deleted from the cache segment. The key-value pair cannot be restored once it is deleted. To know more about the component instancecomponent_service and the segment instance segment_service used below, please refer to their respective help sections. ### Delete using a Key You can delete a key-value pair by passing the key name directly as a parameter to the delete() method. **Parameters Used** <table class="content-table"> <thead> <tr> <th class="w20p">Parameter Name</th> <th class="w20p">Data Type</th> <th class="w60p">Definition</th> </tr> </thead> <tbody> <tr> <td>key</td> <td>String</td> <td>A Mandatory parameter. Will hold the key name of the cache segment.</td> </tr> </tbody> </table> #Delete a key-value pair cache_service = app.cache() segment_service = cache_service.segment() segment_service.delete('Name') Info : Refer to the SDK Scopes table to determine the required permission level for performing the above operation.