Hello,
I have created a cache in environment configurations. I have create no target proxy for this.By using populate cache policy I have store some data to the cache. I have lookupcache policy for retreiving the data from cache. I am getting 200 OK response but how can I know that whether the data is stroed in cache or not.
this what I have given for sample in populate cache policy.
This is lookup cache policy.
Could please guide me.
Thank you.
Answer by Sachhida Das
·
Jan 23, 2017 at 02:26 PM
@NAVAJEEVANA BATHULA: see the trace.. if it is coming from cache then will not call the backend.
Answer by Omid Tahouri
·
Jan 23, 2017 at 02:37 PM
The lookup policy will add flow variables after it is executed - see this page in the documentation for a list of all variables associated with this type of policy.
lookupcache.{policy-name}.cachehit
to understand if the cache lookup returned a result. Does the <Source>
variable you've specified (flowVar
) exist with a value? If not, you won't be caching anything. It's worth noting that the lookup policy is configured to set the value it finds in cache to the variable specified in <AssignTo>
(in your case, f1
).
The <CacheKey>
you are constructing in the two policies must be consistent, otherwise you will never experience a cache hit.
Answer by Dinesh Kumar
·
Jan 24, 2017 at 09:04 AM
Hi NAVAJEEVANA,
Are you getting data in "f1" flow variable or not. If not then it is not stored or your lookup is not configured properly.
Populate cache is for populating data in cache at run time and lookup is for retrieving data at run time. Ideally these two has to be used in different flows/operations. If you did it intentionally for testing purpose then fine.
If "f1" flow variable is not having any data then i see an issue while doing lookup that you are not passing one key fragment value "Cache".
For debug purpose you can do trace on and hit this API from postman for soapui. Better you set the "f1" variable data in your response to verify it.
Thank you @Dinesh Kumar for your response. I am not getting data in "f1" flow variable and working on it.
LookupCache is working weirdly, i.e it's retrieving cache sometimes and other times it's empty 1 Answer
Cache transaction details instead of the application session 3 Answers
Deprecated [TimeoutInSec] in expiry settings in Populate Cache policy 1 Answer