[RFC] version 2 state diagram (take 2)

Poul-Henning Kamp phk at phk.freebsd.dk
Mon Feb 12 13:38:28 CET 2007


I would appreciate if you call could take a moment to look at this
diagram and see if it makes sense:

	http://phk.freebsd.dk/misc/varnish.png

One way or another, something like this will be the cornerstone in
explaning VCL to Varnish users, so I would appreciate feedback from
you guys that this is actually understandable.

The plot has gotten simpler, partly because I did it by hand instead
of using dot(1), but more so because I found out that I needed to
trust VCL to do more things.

I think the result is an improvement.

There are some new vcl functions as a result, so let me present
them all:

    vcl_recv{}
	Good place to check ACLs, rewrite URLS and generally fix
	up things.

	Pipe must be selected from here if necessary.

	If you select pass from here it will not result in a cached
	"pass this one" entry.  This is useful for giving a limited
	subset of clients direct access to the backend.

    vcl_hash{}
	Place holder for the idea that it might be desirable to
	hash on more or different fields than (URL+Host:).

	Not fully thought through yet, may or may not happen.

    vcl_hit{}
	Not really sure what you would do here, but you get
	the chance if you dream up something.

	One possible thing would be to react to high hitrates
	and initiate compression.

    vcl_miss{}
	Fix up headers before requesting from backend

    vcl_pass{}
	Fix up headers before requesting from backend

    vcl_fetch{}
	Fix up headers received from backend.
	Decide if object gets cached or not.
	Determine Time To Live

    vcl_pipe{}
	Fix up headers before requesting from backend
	Hint: Insert "Connection: close" header to terminate
	pipe session after one request.

    vcl_error{}
	Issue error object to client.

Poul-Henning

PS: Computer Science connoisseurs will recognize, the graph as
inspired by figure 3 in the 1975 paper by Søren Lauesen "A Large
Semaphore Based Operating System":  All the arrows point downwards
as intuitive proof that no loops are possible.

-- 
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-misc mailing list