Prevent cache from being resized#59607
Conversation
|
Tagging subscribers to this area: @eerhardt, @maryamariyan, @michaelgsharp Issue DetailsIn the current implementation, additional work is done if a cache entry has already expired, but the cache is large enough to accept it. (e.g.
|
eerhardt
left a comment
There was a problem hiding this comment.
I think this looks good. Thanks for the suggestion.
@Tratcher @adamsitnik - any concerns on this change?
|
Adding an expired entry should be a rare case, but the change seems fine. |
In the current implementation, additional work is done if a cache entry has already expired, but the cache is large enough to accept it. Consider the case when
exceedsCapacity = falseandentry.CheckExpiredreturns true. The cache first grows even if the entry has expired and then shrinks. It would be great in this case not to perform any manipulations regarding the cache size.The approach I suggested would only change that expired entries won't be able to trigger cache compaction. (
exceedsCapacity = trueandentry.CheckExpiredreturns true)