--- title: "Retrieve Data from the Cache" url: https://docs.catalyst.zoho.com/en/sdk/javascript/v1/cloudscale/cache/retreive-data/ description: "This page describes the method to perform operations in the Cache component." last_updated: 2026-09-09T10:45:38Z service: CloudScale type: general related_links: - name: "Catalyst CloudScale" url: /en/cloud-scale/ - name: "Cache Help Documentation" url: /en/cloud-scale/help/cache/introduction/ - name: "Java SDK Documentation" url: /en/sdk/java/v1/cloud-scale/cache/retrieve-data-from-cache/ - name: "Python SDK Documentation" url: /en/sdk/python/v1/cloud-scale/cache/retrieve-data-from-cache/ - name: "REST API Documentation" url: /en/api/code-reference/cloud-scale/cache/insert-key-value-in-segment/#InsertKeyValueinCacheSegment repository: name: "Repository" url: https://github.com/catalystbyzoho/zcatalyst-sdk-js --- # Retrieve Data from the Cache > **Note:** Ensure you have installed the [required package](https://docs.catalyst.zoho.com/en/sdk/javascript/v1/cloudscale/cache/overview/#prerequisites) 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](https://docs.catalyst.zoho.com/en/sdk/javascript/v1/cloudscale/cache/get-segment-instance/). ```javascript //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](https://docs.catalyst.zoho.com/en/sdk/javascript/v1/cloudscale/cache/get-segment-instance/). ```javascript //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 ```json { "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" } ```