在 WCF 中缓存? [英] Caching in WCF?

查看:18
本文介绍了在 WCF 中缓存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建 WCF 服务.我需要将参考数据存储在缓存中,每次我从方法接收到输入时我都会查找它......这样做的正确方法是什么?我还想为缓存定义一个过期策略,在特定时间间隔后使其失效.

I am building a WCF service. I need to store reference data in the cache which I will look up every time I receive input from the method... What is the right way to do this? I would also like to define an expiration policy for the cache that will invalidate it after a certain time interval.

推荐答案

如果您使用的是 .NET 4,推荐的方法是使用 MemoryCache

If you are using .NET 4, the recommended way is to use MemoryCache

这篇关于在 WCF 中缓存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆