Skip to content

Commit b5e00bd

Browse files
SashankBhamidinigoroll
authored andcommitted
docs: Explain extensible builtin subs concept in builtin.vcl
1 parent 85da778 commit b5e00bd

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

bin/varnishd/builtin.vcl

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,25 @@
2828
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2929
# SUCH DAMAGE.
3030
#
31-
# This is the builtin VCL code
31+
# This file contains the builtin VCL code.
32+
#
33+
# All subroutines in this file can be overridden by user-provided VCL.
34+
#
35+
# There are two main patterns for overridable subroutines:
36+
#
37+
# 1. `vcl_builtin_*` subroutines: These wrap core Varnish logic. When you
38+
# override these in user VCL, your code runs first, followed by the
39+
# builtin VCL code (unless you `return()`). Note that calling
40+
# `vcl_builtin_*` from your own `vcl_builtin_*` does not work (triggers
41+
# recursion check).
42+
#
43+
# 2. `vcl_req_*`, `vcl_beresp_*`, etc. subroutines: These act as specific
44+
# "hooks" within the default Varnish behavior. Overriding these allows
45+
# you to modify a narrow aspect of behavior without reimplementing the
46+
# entire parent `vcl_builtin_*` logic.
47+
#
48+
# Consult the Varnish documentation for details on each subroutine and
49+
# its intended use.
3250

3351
vcl 4.0;
3452

0 commit comments

Comments
 (0)