Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

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 250
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