I'm sure I am missing something, but I couldn't find out what it was... I have set up an Azure API Management (consumption plan) API that calls a remote API endpoint and I want to enable caching. The payload almost never changes, so I'm sure caching makes sense here.
This is the policy I have:
<policies>
<inbound>
<base />
<set-backend-service base-url="https://xxxapixxx.azurewebsites.net/api" />
<rewrite-uri template="segments" copy-unmatched-params="true" />
<cache-lookup vary-by-developer="false" vary-by-developer-groups="false" downstream-caching-type="none">
<vary-by-header>Accept</vary-by-header>
<vary-by-header>Accept-Charset</vary-by-header>
</cache-lookup>
</inbound>
<backend>
<base />
</backend>
<outbound>
<base />
<cache-store duration="7200" />
</outbound>
<on-error>
<base />
</on-error>
</policies>
When I test the call in the portal, I see two Trace messages, related to the caching policy:
In the inbound trace:
cache-lookup (0.012 ms) "No appropriate cache found for provided policy configuration. Policy execution will be skipped."
In the outbound trace:
cache-store (0.026 ms) "Request is not cacheable, policy was not applied."
I am guessing it has to do with the gzip compression, but still cannot see how to fix it.
Any guesses, ideas ?