How to check the cache data is deleted or not

Hi

Need help , i'm unable to solve the issue.

Created one proxy to invalidate the cache data, how can i check programmatically whether cached data is deleted or not.

Below are the steps:

1. Created Response cache with the following code:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <ResponseCache async="false" continueOnError="false" enabled="true" name="Response-Cache-1"> <DisplayName>Response Cache-1</DisplayName> <Properties/> <CacheResource>Products</CacheResource> <CacheKey> <Prefix/> <!--<KeyFragment ref="request.uri" type="string"/>--> <KeyFragment ref="request.queryparam.value" type="string"/> </CacheKey> <Scope>Global</Scope> <ExpirySettings> <ExpiryDate/> <TimeOfDay/> <TimeoutInSec ref="">3600</TimeoutInSec> </ExpirySettings> <SkipCacheLookup/> <SkipCachePopulation/> </ResponseCache>

2. Get the cached data using Lookup Cache Policy:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <LookupCache async="false" continueOnError="false" enabled="true" name="Lookup-Cache-1"> <DisplayName>Lookup Cache-1</DisplayName> <Properties/> <CacheResource>cache3</CacheResource> <CacheKey> <Prefix>Lookup Cache-1</Prefix> <KeyFragment ref="request.queryparam.value"/> </CacheKey> <Scope>Global</Scope> <AssignTo>flowVar</AssignTo> </LookupCache>

3. Tried to get the Cached data using <Assignto> element and print the value in JavaScript, but unable to get the value and print the value. Null value is coming in the output.

var ProductsData = context.getVariable("flowVar");

print("Got The Data: " + ProductsData);

0 1 84
1 REPLY 1

The lookup cache policy is used in conjunction with the populate cache policy.

To lookup data from cached that's stored by the response cache policy, you should use the response cache policy again but in the response flow.