如果底层应用程序不可用,什么是好的缓存反向代理可以提供过时的内容?

发布于 2024-07-11 11:37:36 字数 198 浏览 7 评论 0原文

我正在寻找一个缓存反向代理(例如鱿鱼或清漆),能够在发生故障时提供良好的支持来提供过时的内容 - 换句话说,如果我代理的应用程序消失或开始提供内部服务器错误,我'我希望缓存继续提供从后端保存的最后一个好的响应。 本质上,我希望缓存服务器在出现问题时充当额外的保护层。

有没有人配置过 Squid 或类似的东西来做到这一点? 知道有哪些产品支持开箱即用吗?

I'm looking for a caching reverse proxy (something like squid or varnish) with good support for serving stale content in the event of failure - in other words, if the application I'm proxying goes away or starts serving internal server errors I'd like the cache to continue to serve the last good response saved from the back end. Essentially I want the cache server to act as an extra layer of protection should something go wrong.

Has anyone configured Squid or similar to do this? Know of any products that support this out of the box?

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

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

发布评论

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

评论(3

筱果果 2024-07-18 11:37:36

Squid 在 2.7 版本中可以做到这一点。 具体来说,使用 stale-if-error 指令。 更多详细信息请访问:

http://www.mnot.net/blog /2007/12/12/陈旧

Squid can do this in version 2.7. Specifically, use the stale-if-error directive. More details can be found at:

http://www.mnot.net/blog/2007/12/12/stale

回心转意 2024-07-18 11:37:36

看起来 Varnish 还不能处理这个要求: http://varnish.projects.linpro .no/ticket/369

It looks like Varnish can't handle this requirement just yet: http://varnish.projects.linpro.no/ticket/369

彼岸花似海 2024-07-18 11:37:36

这取决于“不可用”的时间有多长。 Squid 有一个配置“refresh_stale_hit”,其主要目的是通过允许在更新缓存时提供稍微陈旧的内容来消除一些延迟。 不过,可以肯定的是,它不会覆盖从网络服务器获得错误响应的情况。 有一个完整的“离线”模式,将继续提供缓存结果(专为...等待...离线使用!),因此代码路径在那里:不确定是否可以将其配置为两个代理好的结果,忽略坏的结果。

It would depend on how long 'unavailable' is. Squid has a config 'refresh_stale_hit' which is mostly designed to remove some latency by allowing slightly stale content to be served while the cache is updated. Pretty sure it won't override getting a bad response from the web server, though. There is a full-on 'offline' mode that will keep serving cached results (designed for ... wait for it ... offline use!) so the code paths are in there: not sure if you can configure it to both proxy good results, and ignore bad ones.

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