--- title: "Update Data in Cache" url: https://docs.catalyst.zoho.com/en/sdk/python/v1/cloud-scale/cache/update-data-in-cache/ service: Cloud Scale type: general related_links: - name: "Update Data in Cache - API" url: /en/api/code-reference/cloud-scale/cache/update-key-value/#UpdateKey-ValuePair - name: "Cache Help" url: /en/cloud-scale/help/cache/introduction - name: "SDK Scopes" url: /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**
| Parameter Name | Data Type | Definition |
|---|---|---|
| cache_name | String | A Mandatory parameter. Will hold the key to be updated in the cache. |
| cache_value | String | A Mandatory parameter. Will hold the value of the key that has to be updated in the cache. |