Populate cache expiry problem

Amr
Bronze 4
Bronze 4

we use populate cache policy and cache expire after 1 hour although we made the expiration after 30 days in configuration cache 

here is my populate cache code 

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<PopulateCache async="false" continueOnError="false" enabled="true" name="PC-JWT-Populate">
<DisplayName>PC-JWT-Populate</DisplayName>
<CacheResource>oauth-token-cache</CacheResource>
<Source>JWS</Source>
<Scope>Global</Scope>
<CacheKey>
<KeyFragment>apiAccessToken1</KeyFragment>
<KeyFragment ref="access_token"/>
</CacheKey>
<ExpirySettings></ExpirySettings>
</PopulateCache>

and look in the configuration we set the value to the 2592000 seconds 

Amr_1-1648150458417.png

we need to know what is the problem here.

appreciate your support @dchiesa1  

Solved Solved
1 4 206
1 ACCEPTED SOLUTION

I am not sure that the configured value is applied to each PopulateCache policy. This may be a bug in the runtime, or it may be an incorrect documentation. 

To be safe, if you want your cache item to live longer, specify the TTL in the PopulateCache policy itself. 

<PopulateCache name="PC-JWT-Populate">
  <CacheResource>oauth-token-cache</CacheResource>
  <Source>JWS</Source>
  <Scope>Global</Scope>
  <CacheKey>
    <KeyFragment>apiAccessToken1</KeyFragment>
    <KeyFragment ref="access_token"/>
  </CacheKey>
  <!-- add the section below -->
  <ExpirySettings>
    <!-- 864000 = 10 days -->
    <TimeoutInSeconds ref='duration_variable'>864000</TimeoutInSeconds> 
  </ExpirySettings>
</PopulateCache>

View solution in original post

4 REPLIES 4

I am not sure that the configured value is applied to each PopulateCache policy. This may be a bug in the runtime, or it may be an incorrect documentation. 

To be safe, if you want your cache item to live longer, specify the TTL in the PopulateCache policy itself. 

<PopulateCache name="PC-JWT-Populate">
  <CacheResource>oauth-token-cache</CacheResource>
  <Source>JWS</Source>
  <Scope>Global</Scope>
  <CacheKey>
    <KeyFragment>apiAccessToken1</KeyFragment>
    <KeyFragment ref="access_token"/>
  </CacheKey>
  <!-- add the section below -->
  <ExpirySettings>
    <!-- 864000 = 10 days -->
    <TimeoutInSeconds ref='duration_variable'>864000</TimeoutInSeconds> 
  </ExpirySettings>
</PopulateCache>

Hi @dchiesa1  Thank you for your fast response, 

first, what about <CacheResource> it will be deleted in this case?
second, is this cache is will be stored in Casandra also or not?

finally, how we can use LookupCache policy without CacheResource or how to get the value of a specific cache without CacheResource element?

@dchiesa1 @ssvaidyanathan can you help me in this case?

first, what about <CacheResource> it will be deleted in this case?

I don;t understand what you are asking here. What do you mean "it will be deleted" ?

second, is this cache is will be stored in Casandra also or not?

Yes, the cache is distributed via a persitence layer.

finally, how we can use LookupCache policy without CacheResource or how to get the value of a specific cache without CacheResource element?

omit the CacheResource element from the configuration. In that case, the policy will read from a generic cache.