Caching 上光油的作用是什么

Caching 上光油的作用是什么,caching,varnish,varnish-vcl,Caching,Varnish,Varnish Vcl,当我们在varnish 4.1服务器后面的应用程序上运行负载测试时,我们注意到在出现服务器错误(返回500,带有缓存控制:无缓存)后,我们的后端出现了负载峰值 在清漆配置中潜水后,我们发现了这条线 : 子vcl\u后端\u响应{ 如果(bereq.不可缓存){ 归还(交付); }否则,如果(beresp.ttl您可能需要阅读 要理解传球命中率 sub vcl_backend_response { if (bereq.uncacheable) { return (deli

当我们在varnish 4.1服务器后面的应用程序上运行负载测试时,我们注意到在出现服务器错误(返回500,带有
缓存控制:无缓存
)后,我们的后端出现了负载峰值

在清漆配置中潜水后,我们发现了这条线 :

子vcl\u后端\u响应{
如果(bereq.不可缓存){
归还(交付);
}否则,如果(beresp.ttl您可能需要阅读

要理解传球命中率

sub vcl_backend_response {
    if (bereq.uncacheable) {
        return (deliver);
    } else if (beresp.ttl <= 0s ||
      beresp.http.Set-Cookie ||
      beresp.http.Surrogate-control ~ "no-store" ||
      (!beresp.http.Surrogate-Control &&
        beresp.http.Cache-Control ~ "no-cache|no-store|private") ||
      beresp.http.Vary == "*") {
        # Mark as "Hit-For-Miss" for the next 2 minutes
        set beresp.ttl = 120s;
        set beresp.uncacheable = true;
    }
    return (deliver);
}