是否有可能在多个Web服务器之间共享HttpRuntime.Cache? [英] Is it possible to share HttpRuntime.Cache between multiple web servers?

查看:732
本文介绍了是否有可能在多个Web服务器之间共享HttpRuntime.Cache?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个storiing在 HttpRuntime.Cache 所有站点数据的Web应用程序。

We have a web application that is storiing all site data in HttpRuntime.Cache.

我们现在需要部署在2个负载均衡的Web服务器应用程序。

We now need to deploy the application across 2 load balanced web servers.

此既然如此,每个Web服务器将具有其自己的高速缓存,这是不理想的,因为如果来自webserver1它一个用户请求的数据将被缓存,但有下一个请求可能会去webserver2和数据,它们previous请求缓存将不可用。

This being the case, each web server will have its own cache, which is not ideal because if a user requests data from webserver1 it will be cached, but there next request might go to webserver2, and the data that their previous request cached won't be available.

是否有可能使用一个共享缓存提供共享两个Web服务器之间或replecate它们之间的高速缓存 HttpRuntime.Cache ,因此,相同的缓存将提供两种Web服务器上?如果是这样,我能做些什么来解决这个问题?

Is it possible to use a shared-cache provider to share the HttpRuntime.Cache between the two web servers or to replecate the cache between them, so that the same cache will be available on both web servers? If so, what can I do to solve this problem?

推荐答案

没有,你不能共享内置的ASP.NET缓存,但你可以使用类似的 memcached的的AppFabric 代替。

No, you can't share the built-in ASP.NET cache, but you could use something like memcached or AppFabric instead.

这篇关于是否有可能在多个Web服务器之间共享HttpRuntime.Cache?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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