From 3c6202c15d7d562cb316bceda9e83c1b9684316f Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Tue, 4 Feb 2020 11:10:30 -0700 Subject: [PATCH] docs: Update header directive with regards to defer --- src/docs/markdown/caddyfile/directives/header.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/docs/markdown/caddyfile/directives/header.md b/src/docs/markdown/caddyfile/directives/header.md index 4f14ec2..6020dae 100644 --- a/src/docs/markdown/caddyfile/directives/header.md +++ b/src/docs/markdown/caddyfile/directives/header.md @@ -6,6 +6,8 @@ title: header (Caddyfile directive) Manipulates HTTP header fields on the response. It can set, add, and delete header values, or perform replacements using regular expressions. +By default, header operations are performed immediately unless any of the headers are being deleted, in which case the header operations are automatically deferred until the time they are being written to the client. + ## Syntax @@ -14,6 +16,7 @@ header [] [[+|-] [|] []] { [+] - + [defer] } ``` @@ -21,6 +24,7 @@ header [] [[+|-] [|] []] { - **<value>** is the header field value, if adding or setting a field. - **<find>** is the substring or regular expression to search for. - **<replace>** is the replacement value; required if performing a search-and-replace. +- **defer** will force the header operations to be deferred until the response is written out to the client. This is automatically enabled if any of the header fields are being deleted. For multiple header manipulations, you can open a block and specify one manipulation per line in the same way.