--- title: "Get a Segment Instance" url: https://docs.catalyst.zoho.com/en/sdk/javascript/v1/cloudscale/cache/get-segment-instance/ 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/get-segment-instance/ - name: "Python SDK Documentation" url: /en/sdk/python/v1/cloud-scale/cache/get-segment-instance/ - 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 --- # Get a Segment Instance > **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. 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](https://docs.catalyst.zoho.com/en/sdk/javascript/v1/cloudscale/cache/get-cache-instance/). > **Note:** If you wish to get the instance of a particular segment, then you need to pass the [segment ID](https://docs.catalyst.zoho.com/en/cloud-scale/help/cache/implementation/#create-a-segment) as the parameter. If you don’t provide any segment ID, it will refer to the default segment. ```javascript // 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 ```