如何使 webfarm 中的 OutputCache 失效?

发布于 2024-08-31 10:03:33 字数 482 浏览 2 评论 0原文

我有一个使用 OutputCache 属性来缓存页面的网站。效果很好。

现在,我正在研发将该网站扩展到网络农场中。除了常见的网络农场问题之外......我注意到(很快/明显)来自Server_A的OutputCache不会使来自Server_B的OutputCache无效..如果尝试使单个服务器的OutputCache无效。这完全有道理 ->当 S_A 在物理上是两台独立的机器时,S_A 如何“告诉”S_B 使其无效,等等?

那么 - 我们的选择是什么?

速度?我知道这会将缓存移动到不同的层..这意味着始终需要确定最终结果(输出)..与记住最终输出内容的OutputCache相反(是的,varby给出了不同的版本,等等..这完全没问题)。因此,即使 poco 或业务对象全部同步,仍然需要最后的渲染工作(即使与生成/同步业务对象的工作相比,它很小......)。

所以是的..不确定这里的选项以及其他人做什么?

i've got a website that uses OutputCache attribute to cache pages. Works great.

Now, I'm in the middle of R&D'ing scaling up this site to be in a web farm. Along with the usual suspects for webfarm pain ... I've noticed (pretty quickly/obviously) that the OutputCache from Server_A doesn't invalidate the OutputCache from Server_B .. if a try and invalidate a single server's OutputCache. This makes total sense -> how can S_A 'tell' S_B to invalidate when they are physically 2 seperate machines, etc?

So - what are our options?

Velocity? I understand this will move the caching to a different layer .. which means that the final result (output) will always be required to be determined .. as opposed to the OutputCache whic remembers the final output content (yes, varby gives different versions, etc.. which is totally fine). So even though the poco or business objects are all sync'd, there's still that last rendering effort required (even if it's tiny .. compared to the effort to generate/sync business objects).

So yeah .. not sure of the options here and what other people do?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

对你而言 2024-09-07 10:03:33

正如您上面所说,ASP.NET 输出缓存是在每个服务器的基础上进行开箱即用的。然而,在 ASP.NET 4.0 中,整个缓存基础结构是可插入的。 ScottGu 有一个 博客文章,介绍如何利用此功能进行输出缓存。我编写了一些使用 Velocity/AppFabric 作为缓存引擎的演示代码,它应该可以实现您想要的功能 - 请查看我的博客此处

As you say above, ASP.NET output caching out of the box works on a per-server basis. However in ASP.NET 4.0 the whole caching infrastructure is pluggable. ScottGu has a blogpost on taking advantage of this for output caching. I've written some demo code that uses Velocity/AppFabric as a caching engine, which should do what you want - have a look at my blog here.

你的他你的她 2024-09-07 10:03:33

看看 memcached

什么是 Memcached?
免费&开源、高性能、
分布式内存对象缓存系统,本质上是通用的,但是
旨在用于加速动态 Web 应用程序
减轻数据库负载。

来自 维基百科

该系统被多个非常大的知名网站使用,包括
YouTube[2]、LiveJournal、维基百科/维基媒体、Amazon.com、Wikia、
SourceForge、Metacafe、Facebook[3][4]、Twitter[5]、Fotolog、The
海盗湾[6] 和 Netlog。[7]

.NET 客户端此处

不幸的是,它在 Windows 上运行得不太好。它可以安装,但最好的集成是与 Linux 集成。

Take a look to memcached

What is Memcached?
Free & open source, high-performance,
distributed memory object caching system, generic in nature, but
intended for use in speeding up dynamic web applications by
alleviating database load.

From wikipedia

The system is used by several very large, well-known sites including
YouTube[2], LiveJournal, Wikipedia/Wikimedia, Amazon.com, Wikia,
SourceForge, Metacafe, Facebook[3] [4], Twitter[5], Fotolog, The
Pirate Bay[6] and Netlog.[7]

A .NET Client here

Unfortunately it doesn't work very well with windows. It can be installed but the best integration is with linux.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文