Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Management APIs for clearing data from Cache Resource

Hi @dchiesa1 ,

Hope you're doing great!

We've cached some data using PopulateCache Policy. Let's say we've used "Testabc" as our CacheResource and now we wanted to clear the data in that resource manually irrespective of "ExpirySettings". We're looking answers for the below approaches that we're thinking of.

  • First Approach - Could you please help us with a management api(if there is one) which could clear the data cached in "Testabc" CacheResource without waiting for timeout settings for deletion.
  • Second Approach - We've implemented a generic proxy(will be used for multiple purposes in future) which will have an InvalidateCache policy as mentioned in the below image.

themj99_1-1722324518120.png

                        - We're able to pass all the params dynamically except the value in <CacheResource> property. I've tried all the possible ways to pass dynamic values to this attribute but unfortunately it's not accepting it. Could you please suggest if there's any way to pass the value to <CacheResource> dynamically instead of Hardcoding it?

Thanks in Advance!!

Manoj Sai T

 

Solved Solved
1 1 393
1 ACCEPTED SOLUTION

In X and hybrid, As far as I know, there's no management API that can clear the runtime cache. 

The API for dealing with caches is here: https://cloud.google.com/apigee/docs/reference/apis/apigee/rest/v1/organizations.environments.caches

It's a little strange because that documentation says you can LIST caches, or DELETE a cache, but it doesnt' say you can CREATE a cache?  So that's odd.  

Anyway you can use a proxy to clear the cache, either with InvalidateCache, or with a PUT with empty data and a 1s expiry. 

What are you hoping to gain by using the CacheResource?  The CacheResource thing was originally conceived as a way to allow people to micro-manage the cache entities within Apigee, so that different "cache resources" could have different default expiry, different maximum sizes, and so on.  But most people don't use that stuff. 

I don't believe you can specify a dynamic CacheResource. Maybe you can just omit that from your various cache policies? 

 

View solution in original post

1 REPLY 1

In X and hybrid, As far as I know, there's no management API that can clear the runtime cache. 

The API for dealing with caches is here: https://cloud.google.com/apigee/docs/reference/apis/apigee/rest/v1/organizations.environments.caches

It's a little strange because that documentation says you can LIST caches, or DELETE a cache, but it doesnt' say you can CREATE a cache?  So that's odd.  

Anyway you can use a proxy to clear the cache, either with InvalidateCache, or with a PUT with empty data and a 1s expiry. 

What are you hoping to gain by using the CacheResource?  The CacheResource thing was originally conceived as a way to allow people to micro-manage the cache entities within Apigee, so that different "cache resources" could have different default expiry, different maximum sizes, and so on.  But most people don't use that stuff. 

I don't believe you can specify a dynamic CacheResource. Maybe you can just omit that from your various cache policies?