告诉varnish不要缓存以.html结尾的请求
我如何告诉Varnish使用VCL配置文件不缓存 任何以告诉varnish不要缓存以.html结尾的请求,varnish,varnish-vcl,Varnish,Varnish Vcl,我如何告诉Varnish使用VCL配置文件不缓存 任何以.html结尾的URL。这是一个Magento网站,我是这样做的 不希望缓存所有以.html结尾的产品页面。我想?.html或*.html可能是我需要的通配符 我还可以告诉Varnish处理任何以 查询字符串?\uuuuuuuu from\u store=0&\uuuuuuuuuuuu store=ie与其相同 如果查询字符串不在那里。所以 example.com/?\uuuuuuu from\u store=0&\uuuuuuuu sto
.html
结尾的URL。这是一个Magento网站,我是这样做的
不希望缓存所有以.html结尾的产品页面。我想?.html
或*.html
可能是我需要的通配符
?\uuuuuuuu from\u store=0&\uuuuuuuuuuuu store=ie
与其相同
如果查询字符串不在那里。所以
example.com/?\uuuuuuu from\u store=0&\uuuuuuuu store=ie
将被视为相同
如Varnish提供的example.com
我的第一部分问题需要的通配符似乎是
*\.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);
}
}
我会使用。*\.html$,因为第二个点将匹配任何字符。另外,您确定要返回“管道”而不是“通过”吗?看:@Ronald,谢谢。在使用生成VCL的扩展时使用了管道,我只是在Magento管理面板的配置部分添加了
*\.html$
,管道和Pass之间有什么区别?