Reputation: 1208
When you configure a cache in Edge you give it some key fragments (e.g. request.uri, request.header.Accept, request.header.Accept-Language, etc.). To clear that key you pass the same key fragments.
If I have 5,000 elements cached, how can I clear the entire cache without generating 5,000 calls to my API with all the possible cache keys?
Upvotes: 2
Views: 2266
Reputation: 469
For anyone looking to do this via policies, you can do it using KeyFragment
and PurgeChildEntries
tags.
Reference - https://docs.apigee.com/api-platform/reference/policies/invalidate-cache-policy#PurgeChildEntriesElement
Upvotes: 0
Reputation: 66
The following API call will also allow you to delete all your cache entries :
curl -v -u admin 'https://api.enterprise.apigee.com/v1/organizations/{org-name}/environments/{env-name}/caches/{cache-name}/entries?action=clear' -X POST
Upvotes: 0
Reputation: 19
The cache can also be cleared from UI.
You can login to UI then go to API's tab under that will be "Environment Configuration" Tab
Here you will get the option to clear entire cache.
Upvotes: 0
Reputation: 96
Invalidate cache policy is used to explicitly invalidate the cache entry for the given CacheKey (Where Cachekey is the combination of 'Prefix and KeyFragment'), not for clearing the all entries, associated with the given Cache resource. Please go through the document here to understand more about 'Invalidate Cache'.
Upvotes: 0
Reputation: 1990
You can use the clear all cache entries API call, documented here. If you don't pass in the prefix query parameter, it should remove all.
Upvotes: 2