在同一物理机上的应用程序(asp.net)之间共享缓存
我们在一个主(根)应用程序内有多个虚拟应用程序。
如果虚拟应用程序和主应用程序位于(并且始终位于)同一台物理计算机上,如何在它们之间共享缓存?
通过缓存我假设 System.Runtime.Caching 或 System.Web.Caching。希望我不需要为此设置 AppFabric 缓存...
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. Hope that i do not need to setup AppFabric Caching for this...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Memcached 是一个免费的开源缓存,作为 Windows 服务运行。您只需定义两个应用程序在 memcached 对象中查找的键即可轻松实现跨应用程序缓存。
Memcached is a free, open-source cache that runs as a Windows service. 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).
做不到。多个 ASP.NET 应用程序位于它们自己的应用程序域中,并且该应用程序域由 IIS 控制,并且可以随时循环。这意味着任何缓存都必须使用网络场景(远程处理等),并且缓存最好适合 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. This means any caching HAS to use networking scenarios (remoting etc.) and the cache better be suited outside the ASP.NET control (system service).
虽然其他人提到了内置的 ASP.NET 缓存 (System.Web.Caching),但请注意,.NET 4.0 引入了一个全新的缓存框架,旨在在 System.Web.Caching 命名空间之外工作:
System.Runtime.Caching
< a href="http://msdn.microsoft.com/en-us/library/system.runtime.caching%28VS.100%29.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com /en-us/library/system.runtime.caching(VS.100).aspx
ASP .Net缓存共享
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:
System.Runtime.Caching
http://msdn.microsoft.com/en-us/library/system.runtime.caching(VS.100).aspx
ASP.Net Cache sharing