Limitation in the expiration of Response Cache policy

Not applicable

I have a question from a customer. Cache expiration on Response Cache policy can be configured with

<ExpirySettings>/<TimeoutInSec>

Also 'Environment Configuration' on Management UI can set Expiration in seconds.

What is the maximum value for them to be configured?

How about <ExpiryDate>?

Or can we just consider that these have no limits actually and take long enough?

Solved Solved
0 4 964
1 ACCEPTED SOLUTION

Dear @Toshihiro Shibamoto ,

Apigee Response Cache <ExpirySettings> supports expiry date, please see usage example below as per docs mentioned here,

<ExpirySettings>
    <ExpiryDate ref="{date_variable}">expiration_date</ExpiryDate>
</ExpirySettings>

Specifies the date on which a cache entry should expire. Use the form mm-dd-yyyy.

<ExpirySettings> also supports <TimeOfDay> & <TimeoutInSec> ,

<TimeOfDay> : The time of day at which a cache entry should expire. Use the form hh:mm:ss .

<TimeoutInSec> : The number of seconds after which a cache entry should expire.

Priority is defined like below, If above configurations are present as siblings in <ExpirySettings> configuration,

TimeoutInSec  > TimeOfDay > ExpiryDate

Idea is, If you would like to expire cache within a small interval of time you will use TimeoutInSec , If you would like to expire cache at a particular time every day you will use TimeOfDay, If you would like to expire cache on a particular date you will use ExpiryDate.

Regarding Environment Cache Configuration:

  • By default, Apigee Cache Policies uses shared cache, However you can override same using <CacheResource> element in response cache policy.
  • You can define your own cache containers instead of shared cache using "Environment Cache Configuration screen"
  • Populate Cache policy and Response Cache policy both override these expiration settings with their own for cache entries they create if <ExpirySettings> element is present. Otherwise they will honor settings provided in "Environment Cache Configuration" settings.

View solution in original post

4 REPLIES 4

Dear @Toshihiro Shibamoto ,

Apigee Response Cache <ExpirySettings> supports expiry date, please see usage example below as per docs mentioned here,

<ExpirySettings>
    <ExpiryDate ref="{date_variable}">expiration_date</ExpiryDate>
</ExpirySettings>

Specifies the date on which a cache entry should expire. Use the form mm-dd-yyyy.

<ExpirySettings> also supports <TimeOfDay> & <TimeoutInSec> ,

<TimeOfDay> : The time of day at which a cache entry should expire. Use the form hh:mm:ss .

<TimeoutInSec> : The number of seconds after which a cache entry should expire.

Priority is defined like below, If above configurations are present as siblings in <ExpirySettings> configuration,

TimeoutInSec  > TimeOfDay > ExpiryDate

Idea is, If you would like to expire cache within a small interval of time you will use TimeoutInSec , If you would like to expire cache at a particular time every day you will use TimeOfDay, If you would like to expire cache on a particular date you will use ExpiryDate.

Regarding Environment Cache Configuration:

  • By default, Apigee Cache Policies uses shared cache, However you can override same using <CacheResource> element in response cache policy.
  • You can define your own cache containers instead of shared cache using "Environment Cache Configuration screen"
  • Populate Cache policy and Response Cache policy both override these expiration settings with their own for cache entries they create if <ExpirySettings> element is present. Otherwise they will honor settings provided in "Environment Cache Configuration" settings.

Thank you Anil for the reply.

I understand your points and there are several options to use. The question is how long the cache expiration is configurable and managed. For the case of <ExpiryDate> is there no end-date we can set, say, one year after still works?

@Toshihiro Shibamoto , Ideally it should work for any date. I assume on a cron run, date will be checked against present date & time. If current date & time > expiry set date then it will be expired.

Thank you Anil for the clear explanation.

I think that should suffice here.