Remove value from cache
cache-remove-value deletes a cached item identified by its key. The key can have an arbitrary string value and is typically provided using a policy expression.
Set the policy's elements and child elements in the order provided in the policy statement. Learn more about how to set or edit API Management policies.
<cache-remove-value key="cache key value" caching-type="prefer-external | external | internal" />
|caching-type||Choose between the following values of the attribute:
Policy expressions aren't allowed.
|key||The key of the previously cached value to be removed from the cache. Policy expressions are allowed.||Yes||N/A|
- Policy sections: inbound, outbound, backend, on-error
- Policy scopes: global, workspace, product, API, operation
- Gateways: dedicated, consumption, self-hosted
<cache-store-value key="@("userprofile-" + context.Variables["enduserid"])" value="@((string)context.Variables["userprofile"])" duration="100000" />
For more information and examples of this policy, see Custom caching in Azure API Management.
For more information about working with policies, see: