I have an app where every time someone logs in, I'm going to temporarily persist a small amount of information in a KeyValueMap. After a reasonable amount of time, I want that information to go away. In the documentation, it says:
If the amount of data might grow beyond 15 MB, be sure to use the ExpiryTimeInSecs element to expire entries before exceeding the limit.
However, looking at this parameter, it says:
For a GET from the KeyValueMap, specifies the duration in seconds after which Edge refreshes its cached value from the KeyValueMap.
A value of -1 means the GET value never expires and, because the value never expires, Edge never refreshes its cached value from the KeyValueMap.
This looks more like a duration of caching value, not a time-to-live. Am I just misinterpreting the documentation or does this not do what I need?
Solved! Go to Solution.
Dear @David Scott ,
Welcome to Apigee Community 🙂
KVMs provide long-term data persistence. It doesn't go away after certain time automatically. You can delete same using KVM Policy itself. Check delete element. You can use one KVM Policy to populate, other to retrieve, & one more KVM policy to delete when some condition matches.
You can also delete them manually using Apigee Edge Management API call.
Regarding, KVM Expiry Time In Secs
Regarding, Populate Cache Policy,
Configures how cached values should be written at runtime. You can cache individual values from response using Populate Cache Policy. You can cache the response from target for specific period of time. Once the time expires, data will be deleted from Apigee Edge Platform. If a cache entry expires there will be no data to return. You need to make sure to populate cache. Populate cache works if it's same API Proxy Endpoint. In your case seems like you will be using data stored in apigee edge in another api call. It may result you will end up sending empty data to other API call (since you mentioned other services) if cache is expired.
I think KVM best suites your use case. You can also refer this article for more information.