httpcontext.current.cache 的多个实例
我使用 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我将使用附加有键的 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".