From dc342286592150c29719d35cb110d2d165547943 Mon Sep 17 00:00:00 2001 From: Vincent Cloutier Date: Wed, 28 Dec 2022 10:37:04 -0500 Subject: [PATCH] cache tweaks --- src/BirdsiteLive.Twitter/CachedTwitterService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/BirdsiteLive.Twitter/CachedTwitterService.cs b/src/BirdsiteLive.Twitter/CachedTwitterService.cs index 68b6bc9..d2d0da5 100644 --- a/src/BirdsiteLive.Twitter/CachedTwitterService.cs +++ b/src/BirdsiteLive.Twitter/CachedTwitterService.cs @@ -19,7 +19,7 @@ namespace BirdsiteLive.Twitter private readonly MemoryCacheEntryOptions _cacheEntryOptions = new MemoryCacheEntryOptions() .SetSize(1)//Size amount //Priority on removing when reaching size limit (memory pressure) - .SetPriority(CacheItemPriority.High) + .SetPriority(CacheItemPriority.Low) // Keep in cache for this time, reset time if accessed. .SetSlidingExpiration(TimeSpan.FromHours(24)) // Remove from cache after this time, regardless of sliding expiration @@ -32,7 +32,7 @@ namespace BirdsiteLive.Twitter _userCache = new MemoryCache(new MemoryCacheOptions() { - SizeLimit = settings.UserCacheCapacity + SizeLimit = 5000 //TODO make this use number of entries in db }); } #endregion