Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/270.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
告诉varnish不要缓存以.html结尾的请求_Varnish_Varnish Vcl - Fatal编程技术网

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

告诉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

我如何告诉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 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之间有什么区别?