Apigee caching

How can we access cache response after the cache store time is over?

0 5 161
5 REPLIES 5

I guess we cannot access cache elements after they get expired.

When cache TTL expires, cache elements are ejected/removed/deleted from the cache automatically.

@Rahul Tiwari

What is your usecase to access expired cache entries?

May be caching is not the right way to handle your data if you want to access after expiry.

I am storing cache for 5 mins, after that response will be fetched from backed , But in case backend is not available within 24 hours response should be populated from the cache itself.

I guess cache is not the right solution for your use-case. You need to have fallback targets/backends to handle any failures.

If you have multiple servers/backends, using APigee's loadbalancing and fallback options on Target side,

https://docs.apigee.com/api-platform/deploy/load-balancing-across-backend-servers#settingloadbalance...

I am storing cache for 5 mins, after that response will be fetched from backed , But in case backend is not available within 24 hours response should be populated from the cache itself.