Michael Bissell
Michael Bissell

Reputation: 1208

Clearing the entire cache in Apigee

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

Answers (5)

Ram
Ram

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

Divya Achan
Divya Achan

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

Jagjyot
Jagjyot

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

Archendra Yadav
Archendra Yadav

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

Mike Dunker
Mike Dunker

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

Related Questions