How to store array of json without Key value mapping

pxzxz1
Participant IV

Hello fellow Apigeeks

Can I want to cache a list of json array and do not want to use Key Value mapping to store the data temporary, can it be done another way?

To cache the data

Proxy endpoint A → Target endpoint B

To retrieve the cache response

Proxy endpoint C → Target endpoint A?

Correct me if I am wrong.

0 5 946
5 REPLIES 5

HI @Patricia Xia - how about expose a flow within the proxy that returns this json array response. You can use the Assign Message policy. And where ever you need this, just do a Service Callout (using Path chaining) to that resource to return that json array ? Similar to Cache but not sure how you will populate and the thought process you have is confusing (not clear).


Hello Saran

I have no used Service Callout before. Possible to explain briefly what is it and how does it work?

You can check the documentation for that kind of information.

If you are intending to cache data, why not use the Apigee cache?

You mentioned KVM, but there is a Cache in Apigee.

Also I don't understand the links you showed between proxy endpoints A, B, and C and how they relate to your goal of caching data. Maybe you could clarify the question.

Not applicable
@Patricia

As you are trying to catch the response you need to use a response cache policy. What I understood is you want to catch the response in the flow proxy endpoint A to proxy target endpoint B and retrieve in the flow proxy endpoint C to target endpoint A. First thing is response cache is automatically get appended to both proxy request preflow and target response postflow at the same time. But to get the advantage of the response cache the request should be the same. As your request is changing you cannot use response cache. But yes you can use the lookup can populate cache with the same key fragment. You can put the policy with condition as per your requirement and you need to specify the scope as "Application" or broder as the endpoints are different.