开发者

Varnish Cache first time hit

开发者 https://www.devze.com 2023-04-05 05:00 出处:网络
I\'m running varnish on a dedicated server. When i load a page, it is delivered via Apache and on the second and subsequent hits it is then delivered v开发者_开发问答ia Varnish Cache (i.e. I can see t

I'm running varnish on a dedicated server. When i load a page, it is delivered via Apache and on the second and subsequent hits it is then delivered v开发者_开发问答ia Varnish Cache (i.e. I can see two timestamps in X-Varnish headers).

But when i open up the same page from some other computer, it's again delivered from the backend (apache) for the first time and on further reloads it comes from Varnish.

If a page is already in Varnish Cache, isn't it supposed to be delivered via Varnish even on a new computer for the first time? I've tried simple hello world php files without any database calls with the same effect. Might it be something wrong with my vcl file or Varnish works this way only?


check whether you sending session data (cookies) which then look like unique calls to varnish. the docs show you how to strip cookies.


Jon is right. I had similar problem. You also need to clean up your cookie and cache before test. Check if the first visit response header, it tries to set cookie. If so, you can do "unset beresp.http.Set-Cookie under vcl_fetch.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号