# 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-03-18T07:41:08.534Z" 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 {{%link href="/en/deployment-and-billing/environments/introduction/"%}}Environments help page{{%/link%}}. <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: * {{%link href="/en/sdk/java/v1/cloud-scale/cache/get-segment-instance/"%}}Cache - Java SDK{{%/link%}} * {{%link href="/en/sdk/nodejs/v2/cloud-scale/cache/get-segment-instance/"%}}Cache - Node.js SDK{{%/link%}} * {{%link href="/en/sdk/python/v1/cloud-scale/cache/get-segment-instance/"%}}Cache - Python SDK{{%/link%}} * {{%link href="/en/api/code-reference/cloud-scale/cache/insert-key-value-in-segment/#InsertKey-ValueinCacheSegment"%}}Cache - API{{%/link%}} -------------------------------------------------------------------------------- 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-03-18T07:41:08.536Z" 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 {{%link href="/en/cloud-scale/help/cache/implementation/#create-a-segment"%}}find the segment ID{{%/link%}} 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-03-18T07:41:08.536Z" 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 {{%link href="https://redis.io/documentation"%}}official documentation of Redis{{%/link%}}. 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-03-18T07:41:08.536Z" 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-03-18T07:41:08.536Z" 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. {{%link href="/en/devops/help/metrics/cache/"%}}Metrics{{%/link%}} 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-03-18T07:41:08.536Z" 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-03-18T07:41:08.536Z" 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 {{%link href="/en/sdk/nodejs/v2/cloud-scale/cache/get-segment-instance/"%}}Java{{%/link%}}, {{%link href="/en/sdk/nodejs/v2/cloud-scale/cache/get-segment-instance/"%}}Node.js SDK{{%/link%}}, {{%link href="/en/sdk/python/v1/cloud-scale/cache/get-segment-instance/"%}}Python SDK{{%/link%}} and the {{%link href="/en/api/code-reference/cloud-scale/cache/insert-key-value-in-segment/#InsertKeyValueinCacheSegment"%}}API documentation{{%/link%}} 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%}}{{%bold class="bold-primary"%}}Note:{{%/bold%}} Catalyst allows you to create upto 20 segments in a project in the {{%link href="/en/deployment-and-billing/environments/introduction/"%}}development environment{{%/link%}}. 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 {{%bold class="bold-primary"%}}support@zohocatalyst.com{{%/bold%}}. We will address each request on a case-by-case basis. There are no upper limits for segments in the production environment.{{%/note%}} 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%}} {{%bold class="bold-primary"%}}Note:{{%/bold%}} * 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).{{%/note%}} 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-03-18T07:41:08.541Z" source: "https://docs.catalyst.zoho.com/en/api/code-reference/cloud-scale/cache/insert-key-value-in-segment/" service: "Cloud Scale" -------------------------------------------------------------------------------- {{% section path="/en/api/code-reference/cloud-scale/cache/insert-key-value-in-segment/" id="InsertKeyValueinCacheSegment" %}} {{%divtag class="LeftContent"%}} # Cache {{%link href="/en/cloud-scale/help/cache/introduction/"%}}Catalyst Cache{{%/link%}} 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%}} {{%bold class="bold-primary"%}}Note:{{%/bold%}}The cache segment must already be created. You can {{%link href="/en/cloud-scale/help/cache/implementation/#create-a-segment"%}}create a segment{{%/link%}} from the Catalyst console or use the default segment.{{%/note%}} ### Request Details #### Request URL {{%request class="apiyellow" req="POST" %}}<p>{api-domain}/baas/v1/project/{project_id}/segment/{segment_id}/cache</p>{{%/request%}} {{%request_id id="api-domain" data="URL" %}}The DC-specific domain to access Catalyst API{{%/request_id%}} {{%request_id id="project_id" data="Numerical" %}}The {{%link href="/en/getting-started/set-up-a-catalyst-project/general-settings/"%}}unique ID{{%/link%}} of the project{{%/request_id%}} {{%request_id id="segment_id" data="Numerical" %}}The {{%link href="/en/cloud-scale/help/cache/implementation/#create-a-segment"%}}unique ID{{%/link%}} of the cache segment {{%/request_id%}} #### Request Headers {{%scope%}} **Authorization:** Zoho-oauthtoken {oauth_token} <br> **Content-Type:** application/json {{%/scope%}} **Optional Headers** <br> {{%scope%}} **CATALYST-ORG:** {org_id} {{%/scope%}} {{%scope%}} **Environment:** Development {{%/scope%}} #### Scope {{%scope%}} ZohoCatalyst.cache.CREATE {{%/scope%}} #### Request JSON Properties {{% nested_fields children="open" border="yes" expandable="no" title="cache_name" textformat="string" condition="mandatory" maxlength=" " %}} Key name of the cache segment <br> Max Size: 50 characters {{% /nested_fields %}} {{% nested_fields children="open" border="yes" expandable="no" title="cache_value" textformat="string" condition="mandatory" maxlength=" " %}} Data value the key represents <br> Max Size: 16000 characters {{% /nested_fields %}} {{% nested_fields children="open" border="yes" expandable="no" title="expiry_in_hours" textformat="long" condition="optional" maxlength="" %}} Duration of expiry in hours <br> Max Size: 48 {{% /nested_fields %}} ### Response Details The response will return the details of the cache item such as the {{%badge%}}cache_name{{%/badge%}}, {{%badge%}}cache_value{{%/badge%}} and {{%badge%}}expires_in{{%/badge%}}, along with the details of the segment it was inserted into. {{%/divtag%}} {{%divtag class="RightContent"%}} {{% panel_without_adjustment header="Sample Request" class="language-bash" %}}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 }’ {{% /panel_without_adjustment %}} {{% panel_without_adjustment header="Sample Response" class="language-json line-numbers"%}} { "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 } }{{% /panel_without_adjustment %}} {{% expand-container %}} {{% expand id="sdk_docs" header="SDK Documentation"%}} {{%link href="/en/sdk/java/v1/cloud-scale/cache/insert-data-into-cache"%}}Insert Key-Value Pair- Java SDK{{%/link%}}</br></br> {{%link href="/en/sdk/nodejs/v2/cloud-scale/cache/insert-data-into-cache"%}}Insert Key-Value Pair- Node.js SDK{{%/link%}}</br></br> {{%link href="/en/sdk/python/v1/cloud-scale/cache/insert-data-into-cache"%}}Insert Key-Value Pair- Python SDK{{%/link%}} {{%/expand%}}</br></br> {{%/expand-container%}} {{%/divtag%}} {{%/section%}} -------------------------------------------------------------------------------- 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-03-18T07:41:08.541Z" source: "https://docs.catalyst.zoho.com/en/api/code-reference/cloud-scale/cache/get-cache-value/" service: "Cloud Scale" -------------------------------------------------------------------------------- {{% section path="/en/api/code-reference/cloud-scale/cache/get-cache-value/" id="GetCacheValue" %}} {{%divtag class="LeftContent"%}} # Get the Value of a Cache Key ### Description This API enables you to retrieve the value of a cache item from a {{%link href="/en/cloud-scale/help/cache/introduction/"%}}segment in the cache{{%/link%}}. 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 {{%request class="apigreen" req="GET" %}}<p>{api-domain}/baas/v1/project/{project_id}/segment/{segment_id}/cache?cacheKey={cache_key}</p>{{%/request%}} {{%request_id id="api-domain" data="URL" %}}The DC-specific domain to access Catalyst API{{%/request_id%}} {{%request_id id="project_id" data="Numerical" %}}The {{%link href="/en/getting-started/set-up-a-catalyst-project/general-settings/"%}}unique ID{{%/link%}} of the project{{%/request_id%}} {{%request_id id="segment_id" data="Numerical" %}}The {{%link href="/en/cloud-scale/help/cache/implementation/#create-a-segment"%}}unique ID{{%/link%}} of the cache segment {{%/request_id%}} #### Query Parameters {{%request_id id="cache_key" data="String" %}}The {{%link href="/en/cloud-scale/help/cache/key-concepts/#cache-items"%}}unique key{{%/link%}} in a segment whose value needs to be retrieved {{%/request_id%}} #### Request Headers {{%scope%}} **Authorization:** Zoho-oauthtoken {oauth_token} {{%/scope%}} **Optional Headers** <br> {{%scope%}} **CATALYST-ORG:** {org_id} {{%/scope%}} {{%scope%}} **Environment:** Development {{%/scope%}} #### Scope {{%scope%}} ZohoCatalyst.cache.READ {{%/scope%}} ### Response Details The response will return the details of the cache item such as the {{%badge%}}cache_name{{%/badge%}}, {{%badge%}}cache_value{{%/badge%}} and {{%badge%}}expires_in{{%/badge%}}, along with the details of its segment. {{%/divtag%}} {{%divtag class="RightContent"%}} {{% panel_without_adjustment header="Sample Request" class="language-bash" %}}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" {{% /panel_without_adjustment %}} {{% panel_without_adjustment header="Sample Response" class="language-json line-numbers"%}} { "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 } } {{% /panel_without_adjustment %}} {{% expand-container %}} {{% expand id="sdk_docs" header="SDK Documentation"%}} {{%link href="/en/sdk/java/v1/cloud-scale/cache/retrieve-data-from-cache"%}}Retrieve Data from Cache- Java SDK{{%/link%}}</br></br> {{%link href="/en/sdk/nodejs/v2/cloud-scale/cache/retrieve-data-from-cache"%}}Retrieve Data from Cache- Node.js SDK{{%/link%}}</br></br> {{%link href="/en/sdk/python/v1/cloud-scale/cache/retrieve-data-from-cache"%}}Retrieve Data from Cache- Python SDK{{%/link%}}</br></br> {{%/expand%}} {{%/expand-container%}} {{%/divtag%}} {{%/section%}} -------------------------------------------------------------------------------- title: "Update Key Value Pair" description: "This API enables you to update a key-value pair in a cache segment." last_updated: "2026-03-18T07:41:08.541Z" source: "https://docs.catalyst.zoho.com/en/api/code-reference/cloud-scale/cache/update-key-value/" service: "Cloud Scale" -------------------------------------------------------------------------------- {{% section path="/en/api/code-reference/cloud-scale/cache/update-key-value/" id="UpdateKeyValuePair" %}} {{%divtag class="LeftContent"%}} # Update a Key-Value Pair ### Description This API enables you to update a key-value pair in a {{%link href="/en/cloud-scale/help/cache/introduction/"%}}cache segment{{%/link%}}. 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 {{%request class="apiblue" req="PUT" %}}<p>{api-domain}/baas/v1/project/{project_id}/segment/{segment_id}/cache</p>{{%/request%}} {{%request_id id="api-domain" data="URL" %}}The DC-specific domain to access Catalyst API{{%/request_id%}} {{%request_id id="project_id" data="Numerical" %}}The {{%link href="/en/getting-started/set-up-a-catalyst-project/general-settings/"%}}unique ID{{%/link%}} of the project{{%/request_id%}} {{%request_id id="segment_id" data="Numerical" %}}The {{%link href="/en/cloud-scale/help/cache/implementation/#create-a-segment"%}}unique ID{{%/link%}} of the cache segment {{%/request_id%}} #### Request Headers {{%scope%}} **Authorization:** Zoho-oauthtoken {oauth_token} {{%/scope%}} **Optional Headers** <br> {{%scope%}} **CATALYST-ORG:** {org_id} {{%/scope%}} {{%scope%}} **Environment:** Development {{%/scope%}} #### Scope {{%scope%}} ZohoCatalyst.cache.CREATE {{%/scope%}} #### Request JSON Properties {{% nested_fields children="open" border="yes" expandable="no" title="cache_name" textformat="string" condition="mandatory" maxlength=" " %}} Key name of the cache segment <br> Max Size: 50 characters {{% /nested_fields %}} {{% nested_fields children="open" border="yes" expandable="no" title="cache_value" textformat="string" condition="mandatory" maxlength=" " %}} Data value the key represents <br> Max Size: 16000 characters {{% /nested_fields %}} {{% nested_fields children="open" border="yes" expandable="no" title="expiry_in_hours" textformat="long" condition="optional" maxlength="" %}} Duration of expiry in hours <br> Max Size: 48 {{% /nested_fields %}} ### Response Details The response will return the details of the updated cache item such as the {{%badge%}}cache_name{{%/badge%}}, {{%badge%}}cache_value{{%/badge%}} and {{%badge%}}expires_in{{%/badge%}}, along with the details of its segment. {{%/divtag%}} {{%divtag class="RightContent"%}} {{% panel_without_adjustment header="Sample Request" class="language-bash" %}}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" }’ {{% /panel_without_adjustment %}} {{% panel_without_adjustment header="Sample Response" class="language-json line-numbers"%}} { "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 } }{{% /panel_without_adjustment %}} {{% expand-container %}} {{% expand id="sdk_docs" header="SDK Documentation"%}} {{%link href="/en/sdk/java/v1/cloud-scale/cache/update-data-in-cache"%}}Update Key-Value Pair- Java SDK{{%/link%}}</br></br> {{%link href="/en/sdk/nodejs/v2/cloud-scale/cache/update-data-in-cache"%}}Update Key-Value Pair- Node.js SDK{{%/link%}}</br></br> {{%link href="/en/sdk/python/v1/cloud-scale/cache/update-data-in-cache"%}}Update Key-Value Pair- Python SDK{{%/link%}}</br></br> {{%/expand%}} {{%/expand-container%}} {{%/divtag%}} {{%/section%}} -------------------------------------------------------------------------------- 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-03-18T07:41:08.541Z" source: "https://docs.catalyst.zoho.com/en/api/code-reference/cloud-scale/cache/delete-key-value/" service: "Cloud Scale" -------------------------------------------------------------------------------- {{% section path="/en/api/code-reference/cloud-scale/cache/delete-key-value/" id="DeleteKeyValuePair" %}} {{%divtag class="LeftContent"%}} # Delete a Key-Value Pair ### Description This API enables you to delete an existing key-value pair from a specified {{%link href="/en/cloud-scale/help/cache/introduction/"%}}cache segment{{%/link%}}. 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 {{%request class="apired" req="DELETE" %}}<p>{api-domain}/baas/v1/project/{project_id}/segment/{segment_id}/cache?cacheKey={cache_key}</p>{{%/request%}} {{%request_id id="api-domain" data="URL" %}}The DC-specific domain to access Catalyst API{{%/request_id%}} {{%request_id id="project_id" data="Numerical" %}}The {{%link href="/en/getting-started/set-up-a-catalyst-project/general-settings/"%}}unique ID{{%/link%}} of the project{{%/request_id%}} {{%request_id id="segment_id" data="Numerical" %}}The {{%link href="/en/cloud-scale/help/cache/implementation/#create-a-segment"%}}unique ID{{%/link%}} of the cache segment {{%/request_id%}} #### Query Parameters {{%request_id id="cache_key" data="String" %}}The {{%link href="/en/cloud-scale/help/cache/key-concepts/#cache-items"%}}unique key{{%/link%}} in a segment whose value needs to be deleted. {{%/request_id%}} #### Request Headers {{%scope%}} **Authorization:** Zoho-oauthtoken {oauth_token} {{%/scope%}} **Optional Headers** <br> {{%scope%}} **CATALYST-ORG:** {org_id} {{%/scope%}} {{%scope%}} **Environment:** Development {{%/scope%}} #### Scope {{%scope%}} ZohoCatalyst.cache.DELETE {{%/scope%}} ### Response Details The response will return the details of the deleted cache item, including the {{%badge%}}cache_name{{%/badge%}}, {{%badge%}}cache_value{{%/badge%}} and {{%badge%}}expires_in{{%/badge%}}. Since the cache entry has been removed, both {{%badge%}}cache_value{{%/badge%}} and expiry fields will return as null. {{%/divtag%}} {{%divtag class="RightContent"%}} {{% panel_without_adjustment header="Sample Request" class="language-bash" %}}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" {{% /panel_without_adjustment %}} {{% panel_without_adjustment header="Sample Response" class="language-json line-numbers"%}} { "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 } } {{% /panel_without_adjustment %}} {{% expand-container %}} {{% expand id="sdk_docs" header="SDK Documentation"%}} {{%link href="/en/sdk/java/v1/cloud-scale/cache/delete-key-value-pair"%}}Delete Data from Cache - Java SDK{{%/link%}}</br></br> {{%link href="/en/sdk/nodejs/v2/cloud-scale/cache/delete-key-value-pair"%}}Delete Data from Cache - Node.js SDK{{%/link%}}</br></br> {{%link href="/en/sdk/python/v1/cloud-scale/cache/delete-key-value-pair"%}}Delete Data from Cache - Python SDK{{%/link%}}</br></br> {{%/expand%}} {{%/expand-container%}} {{%/divtag%}} {{%/section%}} --- ## 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-03-18T07:41:08.547Z" 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 {{%badge%}}getSegmentInstance(){{%/badge%}} method which doesn't actually fire a server side call. This empty segment instance does not hold any values. #### Sample Code Snippet {{% panel_without_adjustment header="Package Imports" class="language-java line-numbers" %}}import com.zc.component.cache.ZCCache; import com.zc.component.cache.ZCSegment; {{% /panel_without_adjustment %}} {{%code class="language-java" scroll="set-scroll" %}}//Get a Cache Instance ZCCache cacheobj=ZCCache.getInstance(); //Get an instance of a specific segment with segment ID ZCSegment segment = cacheobj.getSegmentInstance(1510000000054091L); {{% /code%}} -------------------------------------------------------------------------------- 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-03-18T07:41:08.547Z" 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 {{%badge%}}getCacheValue(){{%/badge%}} method. #### Sample Code Snippet {{% panel_without_adjustment header="Package Imports" class="language-java line-numbers" %}}import com.zc.component.cache.ZCCache; import com.zc.component.cache.ZCSegment; {{% /panel_without_adjustment %}} {{%code class="language-java" scroll="set-scroll" %}}//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"); {{%/code%}} ### 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%}}{{%bold%}}Note:{{%/bold%}} The cache object contains all of its attributes such as key, value, and expiry time.{{%/note%}} #### Sample Code Snippet {{% panel_without_adjustment header="Package Imports" class="language-java line-numbers" %}}import com.zc.component.cache.ZCCache; import com.zc.component.cache.ZCCacheObject; import com.zc.component.cache.ZCSegment; {{% /panel_without_adjustment %}} {{%code class="language-java" scroll="set-scroll" %}}//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 {{%/code%}} -------------------------------------------------------------------------------- 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-03-18T07:41:08.547Z" 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 {{%badge%}}putCache(){{%/badge%}} 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 {{%badge%}}putCacheValue(){{%/badge%}} method. {{%note%}}{{%bold%}}Note:{{%/bold%}} The expiry time is set to 48 hours by default. {{%/note%}} #### Sample Code Snippet {{% panel_without_adjustment header="Package Imports" class="language-java line-numbers" %}}import com.zc.component.cache.ZCCache; import com.zc.component.cache.ZCCacheObject; import com.zc.component.cache.ZCSegment; {{% /panel_without_adjustment %}} {{%code class="language-java" scroll="set-scroll" %}}//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"); {{%/code%}} ### 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%}}{{%bold%}}Note:{{%/bold%}} The value of the expiry time must be passed as a long value in hours. {{%/note%}} #### Sample Code Snippet {{% panel_without_adjustment header="Package Imports" class="language-java line-numbers" %}}import com.zc.component.cache.ZCCache; import com.zc.component.cache.ZCCacheObject; import com.zc.component.cache.ZCSegment; {{% /panel_without_adjustment %}} {{%code class="language-java" scroll="set-scroll" %}}//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); {{%/code%}} ### Insert a key-value pair through a cache object The following code inserts a key-value pair to a cache segment through {{%badge%}}putCacheObject(){{%/badge%}} method. {{%note%}}{{%bold%}}Note:{{%/bold%}} If the key name already exists in a cache segment, it will be replaced with the new value inserted. {{%/note%}} #### Sample Code Snippet {{% panel_without_adjustment header="Package Imports" class="language-java line-numbers" %}}import com.zc.component.cache.ZCCache; import com.zc.component.cache.ZCCacheObject; import com.zc.component.cache.ZCSegment; {{%/code%}} {{%code class="language-java" scroll="set-scroll" %}}//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); {{%/code%}} -------------------------------------------------------------------------------- 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-03-18T07:41:08.547Z" 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 {{%badge%}}updateCacheValue(){{%/badge%}} 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 {{%badge%}}updateCacheValue(){{%/badge%}} method. The expiry time of the key is maintained as its previous value. #### Sample Code Snippet {{% panel_without_adjustment header="Package Imports" class="language-java line-numbers" %}}import com.zc.component.cache.ZCCache; import com.zc.component.cache.ZCSegment; {{% /panel_without_adjustment %}} {{%code class="language-java" scroll="set-scroll" %}}//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"); {{%/code%}} ### 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 {{% panel_without_adjustment header="Package Imports" class="language-java line-numbers" %}}import com.zc.component.cache.ZCCache; import com.zc.component.cache.ZCSegment; {{% /panel_without_adjustment %}} {{%code class="language-java" scroll="set-scroll" %}}//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); {{%/code%}} -------------------------------------------------------------------------------- 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-03-18T07:41:08.547Z" 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 {{%badge%}}deleteCacheValue(){{%/badge%}} method as a parameter. #### Sample Code Snippet {{% panel_without_adjustment header="Package Imports" class="language-java line-numbers" %}}import com.zc.component.cache.ZCCache; import com.zc.component.cache.ZCSegment; {{% /panel_without_adjustment %}} {{%code class="language-java line-numbers" scroll="set-scroll" %}}//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"); {{%/code%}} ### 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 {{%badge%}}deleteCacheObject(){{%/badge%}} method. #### Sample Code Snippet {{% panel_without_adjustment header="Package Imports" class="language-java line-numbers" %}}import com.zc.component.cache.ZCCache; import com.zc.component.cache.ZCCacheObject; import com.zc.component.cache.ZCSegment; {{% /panel_without_adjustment %}} {{%code class="language-java line-numbers" scroll="set-scroll" %}}//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); {{%/code%}} --- ## 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-03-18T07:41:08.549Z" 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. {{%code class="language-javascript" scroll="set-scroll" %}}//Get a cache instance let cache = app.cache();{{% /code%}} -------------------------------------------------------------------------------- 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-03-18T07:41:08.549Z" 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 {{%badge%}}segment{{%/badge%}} reference can be created using the following method which does not fire a server-side call. The {{%badge%}} cache{{%/badge%}} reference used in the code snippet below is the {{%link href="/en/sdk/nodejs/v2/cloud-scale/authentication/get-component-instance" %}}component instance.{{%/link%}} 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. {{%code class="language-javascript" scroll="set-scroll" %}}//Refer a cache segment through the segment ID let cache = app.cache(); let segment = cache.segment();{{% /code%}} -------------------------------------------------------------------------------- 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-03-18T07:41:08.549Z" 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 {{%link href="/en/cloud-scale/help/cache/introduction" %}}Catalyst cache{{%/link%}} 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 {{%badge%}}getValue(){{%/badge%}} 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 {{%badge%}}segment{{%/badge%}} reference used in the code snippet below is the {{%link href="/en/sdk/nodejs/v2/cloud-scale/cache/get-segment-instance" %}}segment instance{{%/link%}} created earlier. {{%code class="language-javascript" scroll="set-scroll" %}}//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); });{{% /code%}} ### 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 {{%link href="/en/sdk/nodejs/v2/cloud-scale/cache/get-segment-instance" %}}segment instance.{{%/link%}} The promise returned here will be resolved to an object which is a JSON. {{%code class="language-javascript" scroll="set-scroll" %}}//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); });{{% /code%}} A sample response that you will receive for each version is shown below: {{% panel_with_select header="Node JS" %}} {{% divtag id="V2" class="language-javascript line-numbers"%}} { 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" } {{% /divtag %}} {{% divtag id="V1" class="language-javascript line-numbers"%}} { 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 } {{% /divtag %}} {{% /panel_with_select %}} -------------------------------------------------------------------------------- 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-03-18T07:41:08.549Z" 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 {{%link href="/en/cloud-scale/help/cache/introduction" %}}cache element{{%/link%}} using the {{%badge%}}put(){{%/badge%}} 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 {{%badge%}}segment{{%/badge%}} reference used in the code snippet below is the {{%link href="/en/sdk/nodejs/v2/cloud-scale/cache/get-segment-instance" %}}segment instance{{%/link%}} created earlier. The promise returned here will be resolved to a JSON object. {{%code class="language-javascript" scroll="set-scroll" %}}//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); });{{% /code%}} A sample response that you will receive for each version is shown below: {{% panel_with_select header="Node JS" %}} {{% divtag id="V2" class="language-javascript line-numbers"%}} { 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" }{{% /divtag %}} {{% divtag id="V1" class="language-javascript line-numbers"%}} { 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 }{{% /divtag %}} {{% /panel_with_select %}} -------------------------------------------------------------------------------- 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-03-18T07:41:08.549Z" 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 {{%badge%}}update(){{%/badge%}} 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 {{%badge%}}segment{{%/badge%}} reference used in the code snippet below is the {{%link href="/en/sdk/nodejs/v2/cloud-scale/cache/get-segment-instance" %}}segment instance{{%/link%}} created earlier. {{%code class="language-javascript" scroll="set-scroll" %}}//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); });{{% /code%}} A sample response that you will receive for each version is shown below: {{% panel_with_select header="Node JS" %}} {{% divtag id="V2" class="language-javascript line-numbers"%}} { 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" } {{% /divtag %}} {{% divtag id="V1" class="language-javascript line-numbers"%}} { 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 } {{% /divtag %}} {{% /panel_with_select %}} -------------------------------------------------------------------------------- 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-03-18T07:41:08.550Z" 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 {{%link href="/en/sdk/nodejs/v2/cloud-scale/cache/get-segment-instance" %}}segment instance.{{%/link%}} ### 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. {{%code class="language-javascript" scroll="set-scroll" %}}//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); });{{% /code%}} --- ## 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-03-18T07:41:08.551Z" 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 {{%link href="/en/cloud-scale/help/cache/introduction" %}}Catalyst Cloud Scale Cache{{%/link%}} 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 {{%badge%}}app{{%/badge%}} reference used in the code below is the {{%link href="/en/sdk/python/v1/setup/#initializing-the-sdk" %}}Python object{{%/link%}} returned as a response during SDK initialization. You can create a new {{%badge%}}cache_service{{%/badge%}}instance as shown below. This instance will be used in multiple scenarios while performing cache component related operations. {{%code class="language-python" scroll="set-scroll" %}}#Get cache component instance cache_service = app.cache() {{% /code%}} -------------------------------------------------------------------------------- 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-03-18T07:41:08.551Z" 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 {{%badge%}}cache_service{{%/badge%}} used below, please refer to {{%link href="/en/sdk/python/v1/cloud-scale/cache/get-component-instance/" %}}this section{{%/link%}}. 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. {{%code class="language-python" scroll="set-scroll" %}}#Get segment instance cache_service = app.cache() segment_service = cache_service.segment() {{% /code%}} -------------------------------------------------------------------------------- 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-03-18T07:41:08.551Z" 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 {{%link href="/en/cloud-scale/help/cache/introduction" %}}Catalyst Cloud Scale Cache{{%/link%}} 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 {{%badge%}}get_value(){{%/badge%}} 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 {{%link href="/en/sdk/python/v1/cloud-scale/cache/get-component-instance/" %}}component instance{{%/link%}} {{%badge%}}cache_service{{%/badge%}} and the {{%link href="en/sdk/python/v1/cloud-scale/cache/get-segment-instance/" %}}segment_service{{%/link%}} {{%badge%}}segment_service{{%/badge%}} 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>{{%badge%}}Key{{%/badge%}}</td> <td>String</td> <td>A {{%bold%}}Mandatory{{%/bold%}} parameter. Will hold the key for retrieving the cache value.</td> </tr> </tbody> </table> {{%code class="language-python" scroll="set-scroll" %}}#Get cache value cache_service = app.cache() segment_service = cache_service.segment() data = segment_service.get_value('key') {{% /code%}} A sample response is shown below : {{%code class="language-json line-numbers" scroll="set-scroll" %}}{ "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", } {{% /code%}} ### 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 {{%badge%}}get(){{%/badge%}} method, where the key name is passed as an argument. To know more about the {{%link href="/en/sdk/python/v1/cloud-scale/cache/get-component-instance/" %}}component instance{{%/link%}} {{%badge%}}cache_service{{%/badge%}} and the {{%link href="en/sdk/python/v1/cloud-scale/cache/get-segment-instance/" %}}segment instance{{%/link%}} {{%badge%}}segment_service{{%/badge%}} 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>{{%badge%}}cache_name{{%/badge%}}</td> <td>String</td> <td>A {{%bold%}}Mandatory{{%/bold%}} parameter. Will hold the key for retrieving the cache object.</td> </tr> </tbody> </table> {{%code class="language-python" scroll="set-scroll" %}} cache_service = app.cache() segment_service = cache_service.segment() data = segment_service.get('key') {{% /code%}} A sample response is shown below : {{%code class="language-json line-numbers" scroll="set-scroll" %}}{ 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" } {{% /code%}} {{%note%}}{{%bold%}}Info :{{%/bold%}} Refer to the {{%link href="/en/sdk/python/v1/sdk-scopes" %}}SDK Scopes table{{%/link%}} to determine the required permission level for performing the above operation.{{%/note%}} -------------------------------------------------------------------------------- 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-03-18T07:41:08.551Z" 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 {{%link href="/en/cloud-scale/help/cache/introduction" %}}cache element{{%/link%}} 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 {{%link href="/en/sdk/python/v1/cloud-scale/cache/get-component-instance/" %}}component instance{{%/link%}} {{%badge%}}cache_service{{%/badge%}} and the {{%link href="en/sdk/python/v1/cloud-scale/cache/get-segment-instance/" %}}segment instance{{%/link%}} {{%badge%}}segment_service{{%/badge%}} 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>{{%badge%}}cache_name{{%/badge%}}</td> <td>String</td> <td>A {{%bold%}}Mandatory{{%/bold%}} parameter. Will hold the key to be inserted in the cache.</td> </tr> <tr> <td>{{%badge%}}cache_value{{%/badge%}}</td> <td>String</td> <td>A {{%bold%}}Mandatory{{%/bold%}} parameter. Will hold the value to be inserted in the cache.</td> </tr> <tr> <td>{{%badge%}}expiry_in_hours{{%/badge%}}</td> <td>Numeric</td> <td>A {{%bold%}}Optional{{%/bold%}} parameter. Will hold the value of the expiry time of the data.</td> </tr> </tbody> </table> {{%code class="language-python" scroll="set-scroll" %}}# Insert Data to Cache cache_service = app.cache() segment_service = cache_service.segment() segment_service.put('Name', 'Smith',2) {{% /code%}} A sample response is shown below : {{%code class="language-json line-numbers" scroll="set-scroll" %}} { 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" } {{% /code%}} {{%note%}}{{%bold%}}Info :{{%/bold%}} Refer to the {{%link href="/en/sdk/python/v1/sdk-scopes" %}}SDK Scopes table{{%/link%}} to determine the required permission level for performing the above operation.{{%/note%}} -------------------------------------------------------------------------------- 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-03-18T07:41:08.551Z" 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 {{%badge%}}update(){{%/badge%}} 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 {{%link href="/en/sdk/python/v1/cloud-scale/cache/get-component-instance/" %}}component instance{{%/link%}} {{%badge%}}cache_service{{%/badge%}} and the {{%link href="en/sdk/python/v1/cloud-scale/cache/get-segment-instance/" %}}segment instance{{%/link%}}{{%badge%}}segment_service{{%/badge%}} 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>{{%badge%}}cache_name{{%/badge%}}</td> <td>String</td> <td>A {{%bold%}}Mandatory{{%/bold%}} parameter. Will hold the key to be updated in the cache.</td> </tr> <tr> <td>{{%badge%}}cache_value{{%/badge%}}</td> <td>String</td> <td>A {{%bold%}}Mandatory{{%/bold%}} parameter. Will hold the value of the key that has to be updated in the cache.</td> </tr> </tbody> </table> {{%code class="language-python" scroll="set-scroll" %}}#Update data in cache cache_service = app.cache() segment_service = cache_service.segment() segment_service.update('Name', 'Michael Scott') {{% /code%}} A sample response is shown below : {{%code class="language-json" scroll="set-scroll" %}}{ 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" } {{% /code%}} {{%note%}}{{%bold%}}Info :{{%/bold%}} Refer to the {{%link href="/en/sdk/python/v1/sdk-scopes" %}}SDK Scopes table{{%/link%}} to determine the required permission level for performing the above operation.{{%/note%}} -------------------------------------------------------------------------------- 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-03-18T07:41:08.552Z" 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 {{%link href="/en/sdk/python/v1/cloud-scale/cache/get-component-instance/" %}}component instance{{%/link%}}{{%badge%}}component_service{{%/badge%}} and the {{%link href="en/sdk/python/v1/cloud-scale/cache/get-segment-instance/" %}}segment instance{{%/link%}} {{%badge%}}segment_service{{%/badge%}} 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 {{%badge%}}delete(){{%/badge%}} 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 {{%bold%}}Mandatory{{%/bold%}} parameter. Will hold the key name of the cache segment.</td> </tr> </tbody> </table> {{%code class="language-python" scroll="set-scroll" %}}#Delete a key-value pair cache_service = app.cache() segment_service = cache_service.segment() segment_service.delete('Name') {{% /code%}} {{%note%}}{{%bold%}}Info :{{%/bold%}} Refer to the {{%link href="/en/sdk/python/v1/sdk-scopes" %}}SDK Scopes table{{%/link%}} to determine the required permission level for performing the above operation.{{%/note%}}