V4 VCL roadmappery...

Poul-Henning Kamp phk at phk.freebsd.dk
Sun Apr 7 22:43:12 CEST 2013


> If you get a 304 from origin on a IMS to origin? Where would you end up. 

The bits on this diagram is all on the "client-side" of things.

The places where you see "fetch" we will (mostly) fork another thread
to do the actual fetching. (exception: pass ?)

If we have an expired obj ("exp_obj"), we'll pass that to the thread,
that will enable it to do conditional fetch (will do by default) and
if we get 304 back well stitch the exp_obj's body into the new object.

> And why would you want to return stale from lookup? (I feel like I am
> missing part of the puzzle)

That's basically what "grace" does today, only now we expose that
decision in VCL.

The default.vcl will look something like:

	sub vcl_lookup {
	    if (obj.uncacheable) {
		return (pass);
	    }
	    if (obj.ttl >= 0s) {
		return (deliver);
	    }
	    if (obj.ttl + obj.grace > 0s) {
		return (stale);
	    }
	    return (fetch);
	}

(input very welcome!)

> And is exp-obj the stale object?

Yes.

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.



More information about the varnish-dev mailing list