Are you storing each array item into Cache with key as their id ?
My first answer will be Yes, you can. However, can you explain the whole use case as to why you want to store them, we could probably discuss other possible solutions as well
First you need to create objects with id, and then you need to put each of the objects in the cache with the Key as the id.
You can use a javascript to write your own code to construct the object, Populate cache policy to store those objects and Lookup cache policy to retreive the objects (if business case needs it).
Yes, It’s definitely possible & quick to implement same in Apigee Edge. It’s tricky to create individual cache entries in Apigee Edge for each id. Find out why below,
Target response contains JSON with multiple items. Even though you can retrieve each item using javascript, you cannot run policy like Populate cache in a loop to store different id’s (items) into different cache entries. As of today, Apigee doesn’t support looping policy.
One more option is, Use a service callout to populate cache & call same using Javascript in a loop. Not a great solution since if your response has 100 items , you will make 100 API calls to the proxy which populates the cache. Not a great way to design same.
A simple way to solve above query is, Store the entire response as cache in Apigee & filter results on a get call using the Extract Variable Policy & Javascript Policy. Take a look at below video that explains how above problem is solved using different policies in Apigee Edge. Attached different proxies used in the video below for your reference.
Additionally, You can enable response cache on above proxy to cache individual items in Apigee cache so that you don’t need to retrieve full payload & parse JSON response every time. I missed this in above video, but you can quickly implement same. Hope it helps. Keep us posted if any.