Popularity Caching Solution

I have a C # application that processes about 10,000 immutable objects, each of which has a size of 50 KB - 1 MB. The application selects about 10-100 objects for each operation. Which objects are selected depends on the circumstances and the user's choice, but there are several that are very often used.

Saving the entire object in memory all the time is too much, but the disk access time is pressed. I would like to use the popularity cache to reduce disk activity. The cache will contain max. 300 objects. I expect during usage patterns to decide which one should be cached. I can easily add an access counter to each object. The more popular it becomes, the less popular it is to leave the cache. Is there a simple, inventive way to do this without coding my butt?

+3
source share
4 answers

One ready-made solution is to use ASP.NET caching a sliding expiration window .

+1
source

, System.Runtime.Caching. , , cahced , , Valid. cahce , .

, .

+1

WeakReferences: .NET .

, , , .

+1

MemCached! , , . http://www.memcached.org.

For a general overview, check out the Wikipedia page at https://en.wikipedia.org/wiki/Memcached .

Good luck

0
source

All Articles