Clarification on Caching technique.

I have implement a porxy which will return responce in service callout policy what is the best way to cache the data.

0 4 167
4 REPLIES 4

Hi @Dinesh Potti, I assume you want to cache the complete response.

We can use Response Cache Policy with appropriate Condition if you wan to enable it only for the Service Callout Response.

If you want to cache particular fields & use them later in the flow you should be looking at Populate & Lookup Cache Policies.

I am getting entire responce in service callout policy and i need to cache and filter the responce

based on the input,when user given second hit i need to skip service call out policy and how can i need to get the responce.

In that case, you can go with Response Cache Policy.

I don't think Response Cache Policy will work with service callouts. When using the policy, you have to attach it twice in the proxy configuration, once in the proxy request flow and once in the response flow

When proxy execution reaches the policy in the request flow, cache lookup happens.

If there is a cache hit, the response is retrieved from cache and processing bypasses backend and other policies until it reaches the Response Cache policy in the response flow, meaning that the backend API invocation will be skipped.

You'll be better off using Lookup Cache and Populate Cache policies. You can cache the full service callout response using these policies. You'll need to add conditions to your service callout and populate cache policies, so that they're only executed if there was a cache miss