Apigee ResponseCache

Not applicable

Hi all, does anyone know if <UseResponseCacheHeaders> is still working?

I am trying to allow it to read the max-age of a HTTP header and cache the message accordingly (using ResponseCache). However, it never caches to the duration set in max-age and only uses the duration set in TimeoutInSec.

Do you know why?

1 1 187
1 REPLY 1

<UseResponseCacheHeaders> is still working?

As far as I know, yes, it's still working! If it is not working, then there's a bug.

I don't know why you would be seeing the results you are seeing.

One guess: if you include BOTH ExpirySettings and UseResponseCacheHeaders, then maybe the ExpirySettings/TimeoutInSec takes precedence. Unfortunately the doc does not currently describe the intended behavior when both are specified.

Did you try to simply remove TimeoutInSec ?

EDIT

Looking at the implementation, it seems that if both UseResponseCacheHeaders AND ExpirySettings, then the timeout used is whichever is less. If you have TimeoutInSecs as 10 seconds and the max-age from the header says 60 seconds, then you will get a 10-second cache TTL.

Does this fit your situation?

If not, then maybe we are seeing a bug. We'd need to collect more information about that.