Announcements
This site is in read only until July 22 as we migrate to a new platform; refer to this community post for more details.
Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Cache update time

Not applicable

Do Populate Cache and Lookup Cache policies work asynchronously? How long does it take apigee to update cache value?

I'm sending 3 requests to my proxy one after another within short period of time.

The first request updates environment cache value using PopulateCache policy(async parameter set to "false"). The second request reads that cache value using LookupCache policy(async="false") but cached value was not updated by previous request. The third request goes after second is finished and it retrieves cache value using the same LookupCache policy as 2nd request but it get's updated value.

I've added js policy that prints current timestamp to my flows and as far as I can see processing of request2 and request3 start after request1 is finished so all cache values should be gresh.

Solved Solved
2 14 1,138
1 ACCEPTED SOLUTION

@Dmitry Lukyanov,

As per the documentation in Cache internals, this is how the PopulateCache works:

When a policy writes to the cache (such as with the PopulateCache policy):

  1. The system puts the entry in both the in-memory cache and the persistent cache.
  2. The system sends all other message processors a request to create a cache entry with the same key, cache name, and value. This ensures that only fresh data is stored.

I investigated the issue further and found that there was an issue with one of the MPs not able to talk to another MP. Hence, when a new value was updated to the cache using PopulateCache policy it was getting updated into only one of the MPs (let's call it as MP 1). However, the new value was not getting propagated to the other MP (let's call it as MP 2). Due to this whenever the "retrieve" request went to the MP 2, it used to return back with the old cache value. And when the request went to MP 1, we used to get the new cache value.

I restarted the MP 1 that had the issue and connection issue with MP 2 was resolved. I ran the APIs in your org several times and confirmed that we are now getting the latest value always.

Can you please verify at your end and let me know it works ?

Thanks,

Amar

View solution in original post

14 REPLIES 14