Support for If-None-Match header.

Geoff Simmons geoff at uplex.de
Mon Jan 23 14:20:57 CET 2017


On 01/23/2017 01:56 PM, Jan Hugo Prins | BetterBe wrote:
> 
> Somewhere I found an old Trac Wiki document that describes
> something like this, but I can't figure out if this has been
> implemented or not. 
> https://www.varnish-cache.org/trac/wiki/BackendConditionalRequests?version=8

That
> 
Wiki page is obsolete -- it was about an experimental branch that
was developed while Varnish 3 was the released version.

(Maybe we should delete the Wiki page, it's not the first time someone
has been led astray.)

Varnish has supported 304 responses to client requests with
If-Modified-Since/If-None-Match for as long as I've known about it
(going back to Varnish 2). Backend conditional requests have been
supported since Varnish 4.

However, by default that doesn't quite work as your flow chart
indicates, if I've understood it correctly. If the client request is
for a cached response with an unelapsed TTL, then Varnish delivers the
cached response unconditionally, without re-validating the response
with the backend. Conditional requests to backends are done for the
fetch after the TTL elapses.

That's the default, but I believe you can get your own VCL to
implement re-validation after cache hits. I haven't tried that myself
-- maybe someone reading the list has some working VCL they can share?


Best,
Geoff
-- 
** * * UPLEX - Nils Goroll Systemoptimierung

Scheffelstraße 32
22301 Hamburg

Tel +49 40 2880 5731
Mob +49 176 636 90917
Fax +49 40 42949753

http://uplex.de

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20170123/5aa60d53/attachment.pgp>


More information about the varnish-misc mailing list