0

Trying to find somewhere where it explicitely says the maximum number of seconds allowed for the duration in the cache-lookup policy for Azure Api Management, but can't see any result

I have seen a sample where it's set to match the max-age value from the header the backend service sends, so I assume i is the seconds in a year as a minimum. At the same time I have seen it's stored as an int?so maybe is the maximum int value in .net?

Thanks

mitomed
  • 2,006
  • 2
  • 29
  • 58
  • "Note that cache duration is set to the max-age value provided in the Cache-Control header received from the backend service or to the deafult value of 5 min if none is found " Reference: https://github.com/Azure/api-management-samples/blob/master/policies/Set%20cache%20duration%20using%20cache%20control%20header.policy.xml – Ecstasy Dec 09 '21 at 06:48
  • `@(context.Variables.ContainsKey("maxAge") ? int.Parse((string)context.Variables["maxAge"]) : 3600)` Reference: [API Management policy expressions - Example](https://learn.microsoft.com/en-us/azure/api-management/api-management-policy-expressions#PolicyExpressionsExamples) – Ecstasy Dec 09 '21 at 06:51
  • 1
    Wil do @DeepDave-MT,wasn't sure how to raise the question to them so this is really helpful. The other links, yes I had seen them but they don't clarify the maximum. Thanks – mitomed Dec 09 '21 at 07:30

0 Answers0