我在使用 Varnish 作为另一台 Varnish 服务器的后端时遇到了麻烦。前端 Varnish 使用基于磁盘的缓存,后端使用malloc来对多个后端服务器进行负载平衡。当我用www.example.com访问后端服务器时,它完美地检索了页面,当我访问前端服务器时,我收到错误:错误200 OK OK大师冥想:XID:1692612819 Varnish 缓存服务器。是否需要进行其他配置才能在另一个后面使用 Varnish 缓存服务器?
最佳答案
这可能是由于缓存副本之间的不一致。尝试应用 HTTP/1.1 访问,并设置 max-age 以获得更好的同步。
Cache-control: max-age: The HTTP/1.1 replacement for the Expires header. While Expires >specifies the validity period using a full time stamp (valid until X day at Y time), max-age >uses a relative system (valid for Z many seconds) to avoid potential problems with time zones >and unsynchronised clocks.
引用:http://www.anchor.com.au/hosting/dedicated/CreatingHighPerformanceDynamicWebSitesWithTheVarnishHttpAccelerator
关于 Varnish "Error 200 OK",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24500282/