duplicate beresp / code not hit in backend_response?

Andreas Plesner apj at mutt.dk
Thu Apr 14 12:51:00 CEST 2016


On Thu, Apr 14, 2016 at 12:34:56PM +0200, Angelo Höngens wrote:
> 
>     set beresp.ttl = 0s;
>     set beresp.uncacheable = true;

Not related to your current problem, but HitPass objects need a TTL.

> What's even more confusing, is that I first see a 'BerespStatus
> 304', and a bit down, I see 'BerespStatus 200'. Huh? Is varnish
> doing two requests to my backend?

The backend is telling varnish to reuse the current object in the cache (HTTP
304 Not Modified), so varnish proceeds to use the object already in the cache
which is a 200.

This is a murky part of varnish, in that the backend really responded 304, but
what we return to the client is a 200, so the definition of whether this is
really a 200 or not is up for debate.

If you purge the object already in the cache first, varnish will not do a
conditional fetch to the backend.

-- 
Andreas



More information about the varnish-misc mailing list