Does the Cache Get Deleted If the Server Goes Into an Idle State?

Copper Contributor

Our application stores data in the server's memory using the IMemoryCache interface and is set to expire after 55 minutes. 

 

 

private async Task<string> GetTokenFromCacheAsync()
{
    return await _cache.GetOrCreateAsync("accessToken", async entry =>
    {
        entry.AbsoluteExpirationRelativeToNow = TimeSpan.FromSeconds(3300);

        return await GetAccessTokenAsync();
    });
}

 

 

What we noticed is that whenever the IIS server goes into an idle state (as set by the idle timeout property), the cache gets deleted. Is there a way to mitigate this problem?

0 Replies