告诉varnish不要缓存以.html结尾的请求


  1. 如何使用VCL配置文件告诉Varnish不要缓存以CCD_ 1结尾的任何URL。这是一个Magento网站,我做不想缓存任何以.html结尾的产品页面。我认为?.html*.html可能是我需要的通配符。

  2. 我还可以告诉Varnish处理任何以查询字符串CCD_ 4如果查询字符串不在那里。所以example.com/?___from_store=0&___store=ie也会受到同样的对待经Varnish鉴定为CCD_ 6。

我第一部分问题所需的通配符似乎是.*.html$

在我的VCL中,我有

sub vcl_recv {
if (req.url ~ "^(/media/|/skin/|/js/|/)(?:(?:index|litespeed).php/)?(?:admin|api|.*.html$|cron.php|checkout|checkout/cart|customer|advancednewsletter|onestepcheckout|onepage|hoi_turpentine|exporter|contacts|iphone|join|sitemap.xml)" ||
req.url ~ "?.*__from_store=") {
return (pipe);
}
}

最新更新