-->

是否有可能设置在上光油不同的路径不同的宽限期?(Is it possible to set a di

2019-10-30 03:05发布

我使用的清漆背后HAProxy的,和高速缓存时间(TTL)从后端使用适当的标题决定。 在光油的一面,我想设置各个路径不同的宽限期,因为对于一些1H宽限期是精细的路径,但对于某些人超过1分钟是不能接受的。

我已经尝试过类似下面,但它似乎不工作:

sub vcl_backend_response {
    unset beresp.http.Set-Cookie;

    if (bereq.url ~ "^/products/\d+/details") {
       # cached for 1h, want to add +1h grace
       set beresp.grace = 1h;
    }
    if (bereq.url ~ "^/products/timeline") {
       # cached for 30s, want to add +1m grace
       set beresp.grace = 1m;
    }
}

可能直到缓存更新不同的路径,或任何其他方式服务陈旧的内容来设置不同的宽限时间?

文章来源: Is it possible to set a different grace period for different paths in Varnish?
标签: varnish