Varnish keeps missing cache ,cookies?

后端 未结 2 1715
没有蜡笔的小新
没有蜡笔的小新 2020-12-28 23:55

I have a bit of trouble getting varnish to cache correctly.

When I go to a page and hit refresh , varnish will return the cached page. But if I use another computer

2条回答
  •  -上瘾入骨i
    2020-12-29 00:55

    You can use the varnishlog command line tool to watch what Varnish is doing as it handles each request. You can see if any cookies are splitting through for example.

    I have a feeling it may be the user-agent that is slightly different on the other computer. Varnish includes this value in the key if it is know. We have a rule in our vcl_recv which is:

    set req.http.User-Agent = "";
    

    Which fixed a similar problem for us.

提交回复
热议问题