azureredisazure-api-managementazure-redis-cacheibm-api-management

Azure api management not hitting azure redis cache when request have more than 10 MB


I have a problem because when I try to configure Azure Api managment with Azure Redis Cache my data does not always get saved, if the request "GET" is up to 9MB everything is okey the key and its value goes to the Redis cache but if the request exceeds 9/10MB the key is not written to the Redis cache. I have checked that the problem is definitely on the side of the api management because if I write to the cache directly from the console application, all the data is written even for 50MB.

My policy in API management : Inbound

  <cache-lookup vary-by-developer="false" vary-by-developer-groups="false" allow-private-response-caching="true" must-revalidate="false" downstream-caching-type="public" caching-type="external" />

outbound

   <cache-store duration="1000" cache-response="true" />

If I change downstream-caching-type to none then request to 9MB not working only request max to 2MB


Solution

  • If I change downstream-caching-type to none then request to 9MB not working only request max to 2MB

    As commented by silent, adding it as a community wiki answer to help community members who might face a similar issue.

    As per API Management limits, maximum cached response size is 2MB.

    You can follow the best practices on how to handle a larger response sizes: