@Syed, Umair Welcome to Microsoft Q&A Forum, Thank you for posting your query here!
I understand that you need documentation about the default APIM cache policy and queries around this.
Firstly, the Azure API Management service has built-in support for HTTP response caching using the resource URL as the key. The key can be modified by request headers using the vary-by
properties. This is useful for caching entire HTTP responses from backend API.
The built-in cache in APIM is designed to improve performance by reducing the number of requests that are sent to the backend API. When a request is received by APIM, it checks the cache to see if it has a cached response for the request. If a cached response is found, APIM returns the cached response instead of forwarding the request to the backend API.
By default, the built-in cache in APIM has a short expiration time. This means that if a response is cached, it will only be stored in the cache for short duration before it is evicted. This helps to ensure that the cache does not contain stale data.
Regarding your query about the built-in cache is volatile, It means that the cache can be cleared periodically during API Management updates or if the expiration time is reached.
Currently the below caching policies are available in APIM:
- Get from cache - Perform cache lookup and return a valid cached response when available.
- Store to cache - Caches response according to the specified cache control configuration.
- Get value from cache - Retrieve a cached item by key.
- Store value in cache - Store an item in the cache by key.
- Remove value from cache - Remove an item in the cache by key.
Please refer the below documentation for the APIM cache performance improvements:
https://learn.microsoft.com/en-us/azure/api-management/api-management-howto-cache***
https://learn.microsoft.com/en-us/azure/api-management/api-management-sample-cache-by-key
Hope this answers. If you have any follow-up questions on this. Please do get back to us. We would be happy to help.
Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.