_cache.Insert(cacheKey, userList, null,
Cache.NoAbsoluteExpiration,
new TimeSpan(0, 15, 0),
CacheItemPriority.High, null);
My code above doesn’t seem to be expiring the cache after 3 minutes, the userList object pulls data from the database that was updated, but the cache doesn’t expire it after 15 minutes.
What is wrong?
You are explicitly setting the cache to never expire by using
Cache.NoAbsoluteExpiration. You want to useCache.NoSlidingExpirationinstead: