Sruthi Varghese Thanks for posting your question in Microsoft Q&A. Does your backend response contain cache headers such as Cache-Control
? If so, this might be as per design.
Can you try the following code snippet (simple way to always use duration
)?
<policies>
<inbound>
<base />
<!-- Cache Lookup -->
<cache-lookup vary-by-developer="false" vary-by-developer-groups="false" allow-private-response-caching="true" must-revalidate="true" downstream-caching-type="none" caching-type="external">
<vary-by-query-parameter>emailaddress</vary-by-query-parameter>
</cache-lookup>
</inbound>
<backend>
<base />
</backend>
<outbound>
<base />
<set-header name="Cache-Control" exists-action="delete" />
<!-- Cache Store -->
<cache-store duration="30" />
</outbound>
<on-error>
<base />
</on-error>
</policies>
If the backend response doesn't have cache headers, then duration should work as expected. If the backend response contains cache headers, whatever the higher value (duration from policy or response header expiration) would be applied.
I hope this helps and let me know if you have any questions.