title: Azure API Management caching does not work with error "Request is not cacheable, policy was not applied."
body: <p>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.</p>
  <p>This is the policy I have:</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;policies&gt;
      &lt;inbound&gt;
          &lt;base /&gt;
          &lt;set-backend-service base-url=&quot;https://xxxapixxx.azurewebsites.net/api&quot; /&gt;
          &lt;rewrite-uri template=&quot;segments&quot; copy-unmatched-params=&quot;true&quot; /&gt;
          &lt;cache-lookup vary-by-developer=&quot;false&quot; vary-by-developer-groups=&quot;false&quot; downstream-caching-type=&quot;none&quot;&gt;
              &lt;vary-by-header&gt;Accept&lt;/vary-by-header&gt;
              &lt;vary-by-header&gt;Accept-Charset&lt;/vary-by-header&gt;
          &lt;/cache-lookup&gt;
      &lt;/inbound&gt;
      &lt;backend&gt;
          &lt;base /&gt;
      &lt;/backend&gt;
      &lt;outbound&gt;
          &lt;base /&gt;
          &lt;cache-store duration=&quot;7200&quot; /&gt;
      &lt;/outbound&gt;
      &lt;on-error&gt;
          &lt;base /&gt;
      &lt;/on-error&gt;
  &lt;/policies&gt;
  </code></pre>
  <p>When I test the call in the portal, I see two Trace messages, related to the caching policy:</p>
  <p>In the inbound trace:</p>
  <blockquote>
  <p>cache-lookup (0.012 ms)
  &quot;No appropriate cache found for provided policy configuration. Policy execution will be skipped.&quot;</p>
  </blockquote>
  <p>In the outbound trace:</p>
  <blockquote>
  <p>cache-store (0.026 ms)
  &quot;Request is not cacheable, policy was not applied.&quot;</p>
  </blockquote>
  <p>I am guessing it has to do with the gzip compression, but still cannot see how to fix it.</p>
  <p>Any guesses, ideas ?</p>