【问题标题】:Magento Turpentine Varnish not working properlyMagento 松节油清漆无法正常工作
【发布时间】:2014-02-23 19:12:57
【问题描述】:

下面是我网站的标题,它是一个安装了松节油的 Magento 网站,它显示了 Varnish Hit,但没有显示年龄标题,它在 @ 上显示“Sortof” 987654321@。请帮忙!

请求标头

Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/;q=0.8
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Cache-Control:no-cache
Connection:keep-alive
Host:www.xyz.com
Pragma:no-cache
Referer:http://www.xyz.com/
User-Agent:Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.71 Safari/537.36

响应标头

Connection:keep-alive
Content-Encoding:gzip
Content-Type:text/html; charset=UTF-8
Date:Fri, 31 Jan 2014 06:46:22 GMT
Server:Apache/2.2.15 (Red Hat)
Transfer-Encoding:chunked
Via:1.1 varnish
X-Powered-By:PHP/5.3.3
X-Turpentine-Cache:1
X-Turpentine-Esi:1
X-Varnish:751218804 751214783
X-Varnish-Currency:
X-Varnish-Esi-Access:
X-Varnish-Esi-Method:
X-Varnish-Hits:5
X-Varnish-Set-Cookie:frontend=6417b8aee0944094808f0b75335c84f3; expires=Fri, 31-Jan-2014 07:39:55 GMT; path=/; domain=www.alldaychemist.com; httponly
X-Varnish-Store:

【问题讨论】:

    标签: php magento caching varnish varnish-vcl


    【解决方案1】:

    Magneto Turpentine 插件有意删除了Age 响应标头。你可以在这里看到它的 Varnish 配置模板:

    https://github.com/nexcess/magento-turpentine/blob/master/app/code/community/Nexcessnet/Turpentine/misc/version-3.vcl#L279

    以下是相关摘录:

            # we'll set our own cache headers if we need them
            unset beresp.http.Cache-Control;
            unset beresp.http.Expires;
            unset beresp.http.Pragma;
            unset beresp.http.Cache;
            unset beresp.http.Age;
    

    简而言之,它按预期工作,没有什么可担心的。

    【讨论】:

    • 谢谢安迪,那么如何检查 Varnish 是否正常工作以及我们的配置是否正确。
    猜你喜欢
    • 1970-01-01
    • 2020-05-29
    • 2015-01-10
    • 1970-01-01
    • 1970-01-01
    • 2015-08-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多