How can you prevent data to be removed from Cache when memory becomes low?

 Posted by Ddd on 3/22/2011 | Category: ASP.NET Interview questions | Views: 3442 | Points: 40

Use the DisableMemoryCollection property of the CacheSection class.

// Set the DisableMemoryCollection property to true.

CacheSection.DisableMemoryCollection = true;
we can also set through web.config file
<cache disableMemoryCollection="true"/>

CacheSection class belongs to System.Web.Configuration name space.

| Alert Moderator 

Comments or Responses

Posted by: Manishsoni on: 4/14/2011 | Points: 10
you can also set Cache Priority.

Based on This Priority System remove cache. low priority cache removed first

Login to post response