httpcontext.current.cache 的多个实例

发布于 2024-12-29 14:27:19 字数 175 浏览 1 评论 0原文

我使用 httpcontext.current.cache 在 WCF 数据服务中缓存两位数据。使用相同的密钥(客户端 ID)存储它们是有意义的,但数据类型不同,过期规则也应该不同。所以,我想知道是否可以创建两个 httpcontext.current.cache 实例?或者,是否有更合适的方法来做到这一点?

最好的。

I am caching two bits of data in my WCF Data Service using the httpcontext.current.cache. It makes sense to store them both using the same key (the client id) but the type of data is different and the expiration rules should be different. So, I was wondering if it was possible to create two instances of httpcontext.current.cache? Or, alternatively, if there is a more appropriate way to do this?

Best.

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

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

发布评论

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

评论(1

同尘 2025-01-05 14:27:19

我将使用附加有键的 ClientId,该键将告诉您正在查看的两条数据中的哪一条。类似于“ClientId-Data1”和“ClientId-Data2”。

I'd use the ClientId appended with a key that will tell you which of the two pieces of data you're looking at. Something like "ClientId-Data1" and "ClientId-Data2".

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