开发者

disable Enterprise Library Caching Application Block

开发者 https://www.devze.com 2022-12-25 21:49 出处:网络
We\'re using the Enterprise Library Caching Application Block to do caching (in memory) in our web service.Works great, no complaints.

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 th开发者_StackOverflow中文版ere 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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号