清漆是否可能向浏览器发送“Cache-Control:no-cache,no-store,must-revalidate”caching控制响应,而varnishcaching响应。
情景是这样的。
我已经尝试使用Cache-Control:no-cache,no-store,必须在set beresp.http.Cache-Control中重新validation,但是这会导致varnish不caching响应。
下面给出了使用的vcl_backend_response。
sub vcl_backend_response { if (bereq.url == "/") { unset beresp.http.expires; unset beresp.http.set-cookie; set beresp.ttl = 3600s; set beresp.http.Cache-Control = "max-age=0"; if (beresp.status >= 400 && beresp.status <= 599) { set beresp.ttl = 0s; } } }
任何帮助,高度赞赏。
当然,在.vclconfiguration文件中使用vcl_deliver:
sub vcl_deliver { set resp.http.Cache-Control = "no-cache, no-store, must-revalidate, private"; set resp.http.Pragma = "no-cache"; }