简体   繁体   English

在同一台物理计算机上的应用程序(asp.net)之间共享缓存

[英]Sharing cache between apps (asp.net) on the same physical machine

We have several virtual applications inside one main (root) application. 一个主(根)应用程序中有几个虚拟应用程序。

How to share Cache between this virtual application and main application if they are located (and always will be) on the same physical machine? 如果虚拟应用程序和主应用程序位于(并将始终位于)同一台物理计算机上,如何在它们之间共享缓存?

By Cache i assuming System.Runtime.Caching or System.Web.Caching. 通过缓存,我假设使用System.Runtime.Caching或System.Web.Caching。 Hope that i do not need to setup AppFabric Caching for this... 希望我不需要为此设置AppFabric缓存...

Memcached is a free, open-source cache that runs as a Windows service. Memcached是作为Windows服务运行的免费开源缓存。 You can very easily accomplish cross-app cacheing by simply defining a key that both apps would use to look for in the memcached object(s). 您只需定义两个应用程序将在memcached对象中使用的键,就可以非常轻松地完成跨应用程序缓存。

While others have mentioned the built in ASP.NET Cache (System.Web.Caching), please note that .NET 4.0 introduces a whole new caching framework designed to work outside of the System.Web.Caching namespace: 虽然其他人提到了内置的ASP.NET缓存(System.Web.Caching),但请注意.NET 4.0引入了一个全新的缓存框架,该框架旨在在System.Web.Caching命名空间之外工作:

System.Runtime.Caching System.Runtime.Caching

http://msdn.microsoft.com/en-us/library/system.runtime.caching(VS.100).aspx http://msdn.microsoft.com/zh-CN/library/system.runtime.caching(VS.100).aspx

ASP.Net Cache sharing ASP.Net缓存共享

Can not be done. 无法完成。 Multiple asp.net apps live in their own appdomain, and the appdomain is IIS controlled and may cycle at any time. 多个asp.net应用程序位于它们自己的appdomain中,并且该appdomain受IIS控制,并且可以随时循环。 This means any caching HAS to use networking scenarios (remoting etc.) and the cache better be suited outside the ASP.NET control (system service). 这意味着任何缓存HAS都可以使用网络方案(远程处理等),并且缓存更好地适合于ASP.NET控件(系统服务)之外。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM