Cache Managers in Enterprise Library caching Application block

caching

I have been using asp web cache in all my prior application developments. I am looking into Ent. Lib caching application block which seems pretty interesting.

However, I have need some clarifications on how the cache managers work?

1- What is the purpose of having multiple cache managers, is it to partition cahing items ? I am used to have only a single cache manager (similar to ent. lib. default cache manager)?

2- Does each cache manager maps to an individual hash table ? or they are all going to be stored in one hash table?

3- If I only use the Null storage option (no backing store) does it make a difference if I use multiple cache managers?

Thanks,

Robert B.

Best Answer

Multiple cache managers allow you to specify different policies for each. These include:

  • the maximum number of items you allow in the cache
  • how often you'd like to poll for expired items

Usually, you'd want these to be configurable based on the items you store in the cache. If you have volatile items that you store for just an hour, you'd like to poll for expired items every ten minutes. If your items can stay in the cache for a week, polling every ten minutes makes little sense and is a waste of resources.

Related Topic