Skip to content

Latest commit

 

History

History
55 lines (37 loc) · 2.73 KB

cache-remove-value-policy.md

File metadata and controls

55 lines (37 loc) · 2.73 KB
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

Remove value from cache

[!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]

Policy statement

<cache-remove-value key="cache key value" caching-type="prefer-external | external | internal"  />

Attributes

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

Usage

Example

<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.

Related policies

[!INCLUDE api-management-policy-ref-next-steps]