缓存在这两个WCF和ASP .NET应用程序(.NET 3.5)可用 [英] Caching usable in both WCF and ASP .NET applications (.NET 3.5)

查看:140
本文介绍了缓存在这两个WCF和ASP .NET应用程序(.NET 3.5)可用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要高速缓存设施,应该从两个WCF和内部的ASP .NET应用程序。我所看到的:

I need caching facility which should work from both WCF and from within an ASP .NET app. I have seen:

  1. 的System.Web.Caching.Cache 这是不是来自WCF可用的(我的理解是可用的只有当服务宿主在IIS中,这是不总是如此)

  1. System.Web.Caching.Cache which is not usable from WCF (as I understand it is usable only if service is hosted in IIS, which is not always the case)

System.Runtime.Caching 这是他们两个人可以使用,但只能从.NET 4中,但我们的.NET版本是3.5。

System.Runtime.Caching which is usable from both of them, but only available from .NET 4, but our .NET version is 3.5.

有什么建议?

推荐答案

您完全可以使用的System.Web.Caching.Cache IIS之外。只需添加一个引用的System.Web 和远离你去 - 这绝对不是IIS的功能

You can absolutely use System.Web.Caching.Cache outside of IIS. Just add a reference to System.Web and away you go - it is absolutely not a feature of IIS.

有在.NET 1.0和1.1的问题,但显然不是在2.0及以上 - 见这篇知识库文章

There were issues in .NET 1.0 and 1.1 but apparently not in 2.0 and upwards - see this Knowledge Base article.

但像达维德Piras酒店我也建议考虑AppFabric中分享你的两个应用程序之间的缓存,如果这将是有益的。我不知道你所说的我的要求无法承受类似的AppFabric的意思 - 以买得起你在说什么性能,内存,还是什么?虽然AppFabric的设计为缓存服务器上使用它不以任何方式需要专门的硬件,你可以,如果你需要运行在同一台机器的服务为您的应用程序。

But like Davide Piras I would also recommend considering AppFabric to share the cache between your two applications, if that would be useful. I'm not sure what you mean by "my requirement cannot afford something like AppFabric" - by "afford" are you talking about performance, memory, or what? Whilst AppFabric is designed to be used on a cache server it does not by any means require dedicated hardware, you can run the service on the same box as your application if you need to.

这篇关于缓存在这两个WCF和ASP .NET应用程序(.NET 3.5)可用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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