ASP.NET Cached Items Being Removed

Lately some of the items I've been placing in cache in ASP.NET have been being removed. When I assigned a callback method to trap these removals, I saw that the reason for removal was "underused" -- ASP.NET was removing these items to free up memory because they weren't being used often.

To prevent this from happening, use the following value for the priority parameter of Cache.Add():
CacheItemPriority.NotRemovable

Comments

Popular Posts

Resolving the "n timer(s) still in the queue" Error In Angular Unit Tests

How to Get Norton Security Suite Firewall to Allow Remote Desktop Connections in Windows

Silent Renew and the "login_required" Error When Using oidc-client

Fixing the "Please add a @Pipe/@Directive/@Component annotation" Error In An Angular App After Upgrading to webpack 4

How to Determine if a Column Exists in a DataReader