views:

183

answers:

1

We're using the Enterprise Library Caching Application Block to do caching (in memory) in our web service. Works great, no complaints.

We're starting to do some load testing, and I've been asked to disable the cache so we can get some relative idea of what kind of performance gain caching gives us. I thought this would be simple - it turns out its not.

I can't find any configuration setting to disable the cache. I suppose I could turn down the maximumElementsInCacheBeforeScavenging setting, but is there a better way?

I found one post that suggests creating your own Cache Manager that does nothing - again, is there a better way to do this?

A: 

Your best bet is to provide a custom implementation of ICacheManager (interface added in Entlib 4, can't help for earlier ones) that doesn't store anything and never gives a cache hit. Then you configure the block to use your "NullCacheManager" or whatever you want to call it.

Chris Tavares