Populate Cache Policy Expiry Date

Not applicable

Hi Team,

I want to store a value in cache for a year i.e till December 31st and refresh the value on January 1st. I am using Expiry Date tag for this.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<PopulateCache async="false" continueOnError="false" enabled="true" name="Populate-Cache-1">
    <DisplayName>Populate Cache-1</DisplayName>
    <Properties/>
    <CacheKey>
        <Prefix/>
        <KeyFragment ref="aprilFirstSunday"/>
    </CacheKey>
    <CacheResource>quota_cache</CacheResource>
    <Scope>Exclusive</Scope>
    <ExpirySettings>
        <ExpiryDate ref="date_variable">December 31</ExpiryDate>
    </ExpirySettings>
    <Source>flowVar</Source>
</PopulateCache>

Please let me know the format of date that is to be entered as I am getting "Invalid expiry value for cache entry. Provided expiry date : December 31."

Solved Solved
1 4 397
1 ACCEPTED SOLUTION

For ExpiryDate use the form mm-dd-yyyy. This is documented here.

Example:

<ExpirySettings><ExpiryDate>12-31-2017</ExpiryDate></ExpirySettings>

View solution in original post

4 REPLIES 4

For ExpiryDate use the form mm-dd-yyyy. This is documented here.

Example:

<ExpirySettings><ExpiryDate>12-31-2017</ExpiryDate></ExpirySettings>

Next question is: when on the date specified does the cache element expire? at 00:00:00 ? or 23:59:59 ? or... ? @Floyd Jones Do you know?

@Dino can specify that in the configuration -

<ExpirySettings>
  <TimeOfDay ref="time_variable">expiration_time</TimeOfDay>
  <TimeoutInSec ref="duration_variable">seconds_until_expiration</TimeoutInSec>
  <ExpiryDate ref="date_variable">expiration_date</ExpiryDate>
</ExpirySettings>

I guess the default is 00:00:00... but it makes sense to validate it and highlight it in docs.

That's a really excellent question that I don't know the answer to. I'll create a doc ticket to handle this (DOC-2000). In the meantime, if somebody else happens to know for sure, please weigh in here.