PopulateCache, TimeoutInSeconds and negative values

I have a PopulateCache policy with a TimeoutInSeconds property referencing a variable:

  <ExpirySettings>
    <TimeoutInSeconds ref="tokenExpirationTime"/>
  </ExpirySettings>

Due to non-related reasons, we had recently a situation in which the variable “tokenExpirationTime” had a negative value. We have fixed that, but I couldn’t find any documentation about Apigee behaviour when something like this happens.

We would expect that Apigee throws some kind of error if you try to cache something for a negative amount of seconds. Instead of that, what we found is that the data is cached forever (we can’t be sure but it lasted several days cached before we deleted it).

Also we have found that if we add a default constant value, it is not used. It seems that a negative number is a valid value for the variable.

We want to confirm if the data remains in cache forever if we use a negative TimeoutInSeconds value. Also, is this a Bug or is it intentional?

Hi @JAAO, we’ve seen your question and encourage the community to jump in with their insights.

In the meantime, feel free to check out the Apigee Knowledge Hub or Past Event Recordings for more. We’ll be watching this thread for update :slight_smile:

Hi!

A platform limit applies to this scenario. Please review the documentation here for details.

1 Like

Hello,

Thank you very much for your answer.

The page you linked doesn’t mention anything about negative values for the TimeoutInSeconds property. So I guess this is a non-documented behaviour: if you use a negative TimeoutInSeconds, then Apigee caches the data for all the time allowed by the platform, which would be 30 days. Am I right?