I am trying to populate some entries in cache , I have used ref variable for setting the <Timeout in Sec> tag.
Please see my policy details below:
<PopulateCache name="PopulateCacheForXYZ"> <DisplayName>PopulateCacheForUSSA</DisplayName> <FaultRules/> <Properties/> <CacheKey> <Prefix/> <KeyFragment ref="XYZcode"/> </CacheKey> <CacheResource>test-cache</CacheResource> <Scope>Global</Scope> <ExpirySettings> <TimeoutInSec ref="expirytime_for_cache">7200</TimeoutInSec> </ExpirySettings> <Source>access_token</Source> </PopulateCache>
So I am fetching "expirytime_for_cache" from KVM , The KVM value is being retrieved correctly , but the Cache Population never exceeding 2 Hours.
Can you please help with the issue?
@Maruti Chand Please find the response of the management API call:
{ "compression": { "minimumSizeInKB": 2048 }, "description": "", "diskSizeInMB": 0, "distributed": true, "expirySettings": { "timeoutInSec": { "value": "36000" }, "valuesNull": false }, "inMemorySizeInKB": 2048, "maxElementsInMemory": 1000, "maxElementsOnDisk": 1000, "name": "test-cache", "overflowToDisk": true, "persistent": false, "skipCacheIfElementSizeInKBExceeds": 1024 }
What you have done here works for me. I suggest that you double check that you have the context variable set properly. You can use the Trace window to do so.
The issue was resolved , the fix was simple if I am specifying the value in TimeoutInSec along with ref value
<TimeOutInSec ref= "timeout">7200</TimeOutInSec>
It always picks the value and doesn't consider ref value , even if ref value is coming , so I just removed the value 7200 and it started working.
Answer by ozanseymen
·
May 11, 2015 at 10:13 PM
Ref attribute in TimeoutInSec works - I don't think this is your problem if you are setting the variable value correctly.
In your cache properties, I am seeing "inMemorySizeInKB": 2048. Is it possible that you are hitting this upper bound when you are caching new data in? Apigee cache works in LRU eviction algorithm.
You are also setting compression minimumSizeInKB to 2048 (same value as inMemorySizeInKB) - are you sure this is correct?
It might make sense to create a new cache resource leaving default values in for those parameters and retrying with lower TTL values.
Answer by Kurt Googler Kanaskie · Jan 13, 2018 at 08:49 PM
Old post, but I was having same issue if I use both the ref and the value, only the value is used.
This behaves differently than the Interval on Quota which treats the literal as a default.
Is this issue resolved? Even form me ref value is not used when I specify some value in TimeoutInSec.
I don't believe it's resolved, in fact I don't know of a bug in the backlog covering this behavior. For now you'll have to workaround the problem.
I've just created a bug for this behavior. b/143612992
It's in the backlog.
Hello all - We are seeing the same issue on our instance of Apigee. I was curious if this bug was already resolved or if this fix is in progress?
I'm facing this issue now. Just curious to know if it is resolved.
Is there a name for the 'default' or 'shared' cache? 5 Answers
How can I fetch expired cache if my API fails from apigee edge 1 Answer
if there is a way to skip caching in L2 1 Answer
Clear multiple cache entries using a single invalidate cache policy flow 0 Answers
Can't I store an object in the Cache? 2 Answers