开发者

disable Enterprise Library Caching Application Block

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜