title | description | services | author | ms.service | ms.topic | ms.date | ms.author |
---|---|---|---|---|---|---|---|
Azure API Management policy reference - cache-remove-value | Microsoft Docs |
Reference for the cache-remove-value policy available for use in Azure API Management. Provides policy usage, settings, and examples. |
api-management |
dlepow |
azure-api-management |
article |
07/23/2024 |
danlep |
[!INCLUDE api-management-availability-all-tiers]
The 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.
[!INCLUDE api-management-policy-generic-alert]
<cache-remove-value key="cache key value" caching-type="prefer-external | external | internal" />
Attribute | Description | Required | Default |
---|---|---|---|
caching-type | Choose between the following values of the attribute: - internal to use the built-in API Management cache,- external to use the external cache as described in Use an external Azure Cache for Redis in Azure API Management,- prefer-external to use external cache if configured or internal cache otherwise. Policy expressions aren't allowed. |
No | prefer-external |
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: classic, v2, consumption, self-hosted, workspace
<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.
[!INCLUDE api-management-policy-ref-next-steps]