Cache Clear API

Not applicable

Hello! I want to write some organization-level calls that will allow developers to, optimally:

1. list everything in cache, returning a list of names

2. display the properties for a cache item, given the name

3. list all cached entries, given the name

4. list all cached entries matching an input regex

5. enable (or disable) the prefetch property of a cached item, given the key

In order for these calls to meet the requirements, they would need to be outside of admin-level access. I'm writing to get a sanity check on this, in general, but also to gather any strategy tips or guidance the community might have. Thanks in advance!

0 1 495
1 REPLY 1

Hi Dieter

I think you are trying to expose an application-centric cache. You said you want *Developers* to be able to make these calls. In what context? Not within the context of an executing client app? Do you mean , administratively?

There is no runtime configuration for the LookupCache policy that retrieves all of the cache keys. You could build something like this , but it would mean managing the cache keys themselves separately (and redundantly). This smells kinda funny to me, violating DRY, so I'm hesitant to recommend it strongly.

What are you really trying to do?

  • What's in the cache?
  • why do "developers" need to list the "properties" for a cache item? (and what properties are you looking for?)
  • what do you mean "enable or disable prefetch"?

If it's something exotic, then I could imagine writing a Java callout that uses the Guava LoadingCache and exposes all those operations that you described. But this would not use the Apigee Edge cache, it would use a separate, in-memory cache stored by the MP (Via the Java callout). It would give you full control over the loading and expiry of the cache, being able to iterate over cache keys and cached values, and so on.