Azure API Management: How to Add Custom Caching Policy for GET Requests Using Policies
I've been working on this all day and I'm dealing with I'm trying to implement a caching policy for GET requests in Azure API Management (APIM) to improve performance... I've followed the documentation, but I'm working with unexpected behavior where my caching policy seems to be ignored. I've configured a policy in the inbound section of my API like this: ```xml <inbound> <base /> <cache-lookup vary-by-developer="false" vary-by-developer-groups="false" vary-by-developer-groups="false" /> </inbound> <backend> <base /> </backend> <outbound> <base /> <cache-store duration="300" /> </outbound> <on-behavior> <base /> </on-behavior> ``` However, when I call the GET endpoint, I consistently receive a 200 OK response, but the response time doesn't show any improvement. I expected that once the cache is populated, subsequent requests should return the cached response without hitting the backend. I've tested with different caching durations, but it seems like the cache is not being utilized at all. I'm also not seeing any errors in the APIM logs. For troubleshooting, I checked the following: - The API settings are configured correctly and the caching policy is applied to the right operation. - I ensured that the response I want to cache does not have cache-control headers set to "no-store" or "no-cache" from the backend service. - I've also verified that my developer portal is not returning cached responses (which I expected when using the policy). Could there be something I'm missing in the cache configuration? Or is there a specific condition under which the cache policy won't work as expected? Any insights or further debugging steps would be appreciated! I'd be grateful for any help. I'd love to hear your thoughts on this. For reference, this is a production CLI tool.