禁用企业库缓存应用程序块

发布于 2024-08-28 00:08:37 字数 397 浏览 2 评论 0原文

我们使用 Enterprise Library Caching Application Block 在我们的 Web 服务中进行缓存(在内存中)。效果很好,没有抱怨。

我们开始进行一些负载测试,我被要求禁用缓存,这样我们就可以对缓存给我们带来的性能增益有一些相对的了解。我以为这很简单 - 事实证明并非如此。

我找不到任何配置设置来禁用缓存。我想我可以关闭 MaximumElementsInCacheBeforeScavenging 设置,但是有更好的方法吗?

我发现一篇 帖子 建议创建自己的不执行任何操作的缓存管理器 -再说一遍,有更好的方法吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

浊酒尽余欢 2024-09-04 00:08:37

最好的选择是提供 ICacheManager 的自定义实现(Entlib 4 中添加的接口,对早期的接口没有帮助),它不存储任何内容,也不会产生缓存命中。然后,您配置该块以使用“NullCacheManager”或任何您想要的名称。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文