Builtin VCL / default VCL
Make sure you understand this: Your own VCL-configuration will not overwrite this default configuration, it will just be prepended to each sub. Unless your VCL code executes a terminating statement (e.g. return(pass)) it will continue into these default subs.
The VCL flow diagram can help with understanding how the request processing state engine is executed, and at which time Varnish calls into the functions of your VCL configuration.
In Varnish 4.0, the flow diagram looks like varnish_flow_4_0.png (in 3.0 like varnish_flow_3_0.png). If you'd like to to generate an image like below from the source, you will need to install GraphViz. This will provide you with the dot command which is used to generate the chart. From your checkout, run:
### Varnish 4.0: $ sed -n '/^DOT/s///p' varnish-cache/bin/varnishd/cache/cache_req_fsm.c | dot -Tpdf > /tmp/varnish_flow.pdf ### Varnish 3.0: $ sed -n '/^DOT/s///p' varnish-cache/bin/varnishd/cache_center.c | dot -Tpdf > /tmp/varnish_flow.pdf
(97.4 KB) -
added by perbu 2008-09-12T19:59:04+02:00 ago.
(738 bytes) -
added by perbu 2008-09-12T20:05:00+02:00 ago.
The dot-file for the graph.
(181.5 KB) -
added by kane 2009-08-28T13:26:53+02:00 ago.
(59.0 KB) -
added by kristian 2011-09-08T09:50:46+02:00 ago.
Update the 3.0-flow to include return(restart) in vcl_error
- varnish_flow_3_0.png (59.0 KB) - added by martin 2014-11-17T14:18:41+01:00 ago.
- varnish_flow_4_0.png (89.4 KB) - added by martin 2014-11-17T14:18:54+01:00 ago.