Builtin VCL / default VCL

The builtin VCL (builtin.vcl) (in 3.0 lingo this was called the default VCL (default.vcl)) is a set of VCL rules that are built in to Varnish.

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 Download (in 3.0 like varnish_flow_3_0.png Download). 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