Hi Team,
Please help on the below caching issue.
Step 1: API A ,I'm caching the back-end response using response cache policy.
Step2 : API B, I'm trying to access the cached response(Which is cached in the API A using Response cache policy) using lookup cache policy.
Here i'm not able to access the cached data but i have verified cache key's which is generated in the both policy and scope as well.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <LookupCache async="false" continueOnError="false" enabled="true" name="LC-B-API"> <DisplayName>LC-B-API</DisplayName> <Properties/> <CacheKey> <Prefix>flow.apigee</Prefix> <KeyFragment ref="request.queryparam.aa"/> </CacheKey> <CacheResource>Test-Cache</CacheResource> <Scope>Exclusive</Scope> <AssignTo>LC_resp</AssignTo> </LookupCache>
<ResponseCache async="false" continueOnError="false" enabled="true" name="RC-API-A"> <DisplayName>RC-API-A</DisplayName> <Properties/> <CacheKey> <Prefix>flow.apigee</Prefix> <KeyFragment ref="request.queryparam.aa"/> </CacheKey> <CacheResource>Test-Cache</CacheResource> <Scope>Exclusive</Scope> <ExpirySettings> <TimeoutInSec>300</TimeoutInSec> </ExpirySettings> <SkipCachePopulation>response.status.code != 200</SkipCachePopulation> <br>
Try using scope as Global in both the policies,
<Scope>Global</Scope>
Exclusive scope will append proxy name to the cache name and hence you cannot access it from different proxies.
If we add a prefix in cache key, it will append the only prefix value as part of key.