varnish屏蔽control+F5导致缓存失效

时间:2023-03-09 13:09:31
varnish屏蔽control+F5导致缓存失效

刚刚接触Varnish缓存,对静态资源进行缓存。目前问题,当浏览器Control+F5刷新页面,导致缓存失效、

参照:http://zhangxugg-163-com.iteye.com/blog/1075206 修改下Varnish配置

sub vcl_hit {

#if (req.http.Cache-Control ~ "no-cache") {

#  if (! (req.http.Via || req.http.User-Agent ~ "bot|MSIE")) {
#      set obj.ttl = 0s;
#      return (restart);
#   }
#}
  return(deliver);
}