CacheItemPriority.NotRemovable

CacheItemPriority.NotRemovable - doesn’t make much difference

--

Also, I found something that maybe useful
“You can indirectly control the memory size of the cache by using the memoryLimit attribute in in machine.config. The cache engine will start throwing items out of the cache agressively when that memory limit is getting close.”

I’ll try reducing that and testing on my PC
Also, see this

Apparently, things can get thrown out even if “NotRemovable”
Which is strange because apparently even “inProc session” uses NotRemovable cache internally

Another thing is
We’re using DateTime.MaxValue for absoluteExpiration
ideally, we should use NoAbsoluteExpiration
But internally they are the same

But I’ll try reducing the memory and see

Cache.NoAbsoluteExpiration “When used, this field sets the absoluteExpiration parameter equal to MaxValue, which is a constant representing “ Same thing, actually...

We do this
Cache.Insert(index, _CacheKeys, null, DateTime.MaxValue,

Ideally, it should be
Cache.Insert(index, _CacheKeys, null, Cache.NoAbsoluteExpiration,

But I don’t think it should really make any difference... internally they are supposed to be the same... let me see if I can replicate the error by reducing memory

Also, check this out

memoryLimit
“ Specifies the maximum allowed memory size, as a percentage of total system memory, that the worker process can consume before ASP.NET launches a new process and reassigns existing requests. The default is 60 percent “

it may useful in future - that we can lose stuff from session and cache too.
Cache Configuration ASP.NET
cache max slidingExpiration

Comments

Archive

Show more