Delete Cache ItemAdmin Scope
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.
copy
// 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);
Last Updated 2026-07-02 14:51:41 +0530 IST
Yes
No
Send your feedback to us
Skip
Submit