varnishncsa %s in backend mode: 304 logged as 200

Rainer Canavan rainer.canavan+varnish at sevenval.com
Thu Oct 31 16:16:22 UTC 2019


Hi,

we want to get a better understanding how well our varnish setup is
performing. We've got two varnishncsa running, one with '-b' and one
without, and each with their own logformat configuration. Each of
those configurations contains "status":%s. Varnish version is
varnish-6.2.1.

If varnish successfully revalidates a stored response, i would expect
the backend log to show a status of 304, and the client log a status
of 200, but in reality, the vanishncsa running with "-b" also reports
a status of 200.

Just to make sure, I've watched with tcpdump what's going on, and
varnish does really receive a 304 from the backend. The client sends

GET /test/5db010a2-07a5-4119-b90b-ed7328c42231 HTTP/1.1
Host: cachetest.backend
[...]

and receives from varnish:

HTTP/1.1 200 OK
Cache-Control: max-age=3600
Date: Thu, 31 Oct 2019 14:43:19 GMT
Etag: "ASKCUMEWOGYQIAS"
[...]

The same request between varnish and the backend:

GET /test/5db010a2-07a5-4119-b90b-ed7328c42231 HTTP/1.1
Host: cachetest.backend
If-None-Match: "ASKCUMEWOGYQIAS"
[...]

HTTP/1.1 304 Not Modified
Cache-Control: max-age=3600
Date: Thu, 31 Oct 2019 14:43:19 GMT
Etag: "ASKCUMEWOGYQIAS"
Connection: close

Is there another statement for the varnishncsa log format that shows
the "real" backend HTTP status? Does this work as intended, or is this
a bug?

Rainer


More information about the varnish-misc mailing list