Setting expirationPollFrequencyInSeconds / maximumElementsInCacheBeforeScavenging to a custom CacheManager

Topics: Building and extending application blocks, Caching Application Block
Feb 21, 2012 at 6:16 PM

I have a custom CacheManager and I would like to establish expirationPollFrequencyInSeconds / maximumElementsInCacheBeforeScavenging. How can I do that?

Any help would be appreciated.



Feb 22, 2012 at 5:22 AM

Are you talking about the configuration data or the implementation?  

I would recommend downloading/installing the source code to Enterprise Library (if you haven't done so).  For configuration you can look at the CacheManagerData class.  For expiration you can look at the ExpirationPollTimer class and for scavenging you can look at the ScavengerTask class.  

If the functionality as written in the Caching Block suits your needs you can probably just reuse the Enterprise Library implementation for expiration and scavenging.

Randy Levy
Enterprise Library support engineer