Maximum duration for Azure Api Management cache

Marco GG 1 Reputation point
2021-12-09T07:33:03.317+00:00

Hi,

Trying to find out if there's a maximum value for "duration" in the cache-lookup policy for Azure Api Management other than the max int value. Would you be able to confirm?

Thanks

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
2,447 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. MayankBargali-MSFT 70,936 Reputation points Moderator
    2021-12-09T09:56:28.953+00:00

    @Marco GG I believe you are talking about Store to Cache policy where we define the duration in seconds. The durability of the internal cache is specified in the setting:

    <cache-store duration="3600" />  
    

    If your operations are heavily dependent on having good and persistent caching then you should consider the use of external caching where one will be able to have control over all the aspects of the caching mechanism.
    In case if you are using the internal caching the cache will be cleaned due to APIM updates (customer or azure) which is not predictable but is not expected to be with a high frequency.
    You can set any value of duration but as Built-in cache is volatile and is shared by all units in the same region in the same API Management service your set value will may or may not be valid.
    The volatile part is documented in the Important section here.


  2. Zach Peters 0 Reputation points
    2024-10-17T17:10:14.0666667+00:00

    I couldn't find a reference to this anywhere in any documentation, but through some experimentation I have found that the maximum allowed value is:

    • 2147483647 (seconds)

    This is just over 68 years.

    This is the maximum positive value for a 32-bit signed integer.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.