清漆清除 – 在浏览器上刷新

我们使用varnish在2台运行drupal的Web服务器上代理/caching内容。 这样说的话,一切似乎都已经到了,页面正在被caching,drupal能够做出清除请求等等。 然而,我们看到一个奇怪的问题,当你调出页面并进行硬刷新(shift +刷新)时,我们得到一个'Error 200 Purged'的报告。 这只发生在硬刷新。 随后的刷新将返回页面。

configuration是一个简单的清除块,每个公共文档。 我们在这里做错了什么,这样硬刷新导致这个错误?

# Allow purging if (req.method == "PURGE") { if (!client.ip ~ purge) { # Return Error 405 if not allowed. return (synth(405, "Forbidden - Not allowed.")); } return (purge); } 

错误+ shift +刷新:

错误200清除

在此事先感谢您的任何指示。

在与光泽IRC频道的Reza交谈之后,看起来我有一大堆代码在那里破裂和不安全。 大块是:

 if (req.http.Cache-Control ~ "(?i)no-cache") { # http://varnish.projects.linpro.no/wiki/VCLExampleEnableForceRefresh # Ignore requests via proxy caches and badly behaved crawlers # like msnbot that send no-cache with every request. if (! (req.http.Via || req.http.User-Agent ~ "(?i)bot" || req.http.X-Purge)) { #set req.hash_always_miss = true; # Doesn't seems to refresh the object in the cache return(purge); # Couple this with restart in vcl_purge and X-Purge header to avoid loops } } 

删除后,一切都按预期工作。 谢谢Reza