Response cache break timeout based on route resource

Not applicable

Can response cache timeouts vary across API resources?

For example, this works as expected.

API response cache for 1hr.

http://test.net/v1/base/alpha

<CacheKey>

<Prefix/>

<KeyFragment ref="request.uri" type="string"/>

</CacheKey>

<Scope>Exclusive</Scope>

<ExpirySettings>

<ExpiryDate/>

</TimeOfDay>

<TimeoutInSec ref="">3600</TimeoutInSec>

</ExpirySettings>

How can i configure Apigee to only cache this response for 15 secs?

http://test.net/v1/base/beta

Is there a way to add conditional logic into "TimeoutInSec" ?

<TimeoutInSec ref="">3600</TimeoutInSec>

Thanks in advance

0 1 336
1 REPLY 1

Hi @rborchers - You can probably have a policy before Response Cache to set the timeout in a flow variable (probably configure the timeouts in KVM and populate the variable using the KVM GET policy) and then call the Response Cache with the variable as ref for TimeoutInSec. With this you can change configurations easily. You can also leave a default value so that it uses that if the values are not found in KVM. In other words, you need to add only those in KVM that is not default.