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! Go to Solution.
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):
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