本文介绍了从Varnish重新验证过期缓存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们目前正在将服务器迁移到新的PLESK 12.5服务器上,该服务器不支持PHP应用程序的Varnish缓存.

We are currently moving our servers to a new one, with PLESK 12.5 which doesn't support Varnish cache for our PHP applications.

我们使用Varnish,主要是为了实现重新验证时有效"功能,以便我们可以在刷新缓存时发送整页或部分内容(使用ESI),而无需等待任何客户的时间.

We use Varnish, mostly for the 'stale-while-revalidate' capability, so that we can send whole pages or parts (using ESI) without any waiting time for any customer while cache is refreshing.

对于类似的缓存,Varnish是否可以替代?可以在PLESK上运行的另一个程序",还是任何PHP/服务器缓存?

Is there any alternative to Varnish for a similar kind of cache ? Either another "program" that could run on PLESK, or any PHP/server cache ?

PLESK随NGINX一起提供,但似乎没有提供过时验证"功能;我也知道PLESK不支持Squid.

PLESK comes with NGINX, but it does not seem to provide 'stale-while-revalidate' capabilities ; I also know Squid isn't supported on PLESK.

推荐答案

实际上,nginx通过 proxy_cache_use_stale Nginx支持缓存-自1.11.10起的控制扩展名:

Actually nginx provides stale-while-revalidate by proxy_cache_use_stale and Nginx supports Cache-Control extensions since 1.11.10:

location / {
    ...
    proxy_cache_use_stale updating error timeout http_500 http_502 http_503 http_504;
    proxy_cache_background_update on;
}

这篇关于从Varnish重新验证过期缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-24 23:17