From 1e9468c9e7b095bfcd92c682df24fb331421608d Mon Sep 17 00:00:00 2001
From: Eric Covener Header set Set-Cookie testcookie "expr=-z %{req:Cookie}"
+ Header append Cache-Control s-maxage=600 "expr=%{REQUEST_STATUS} == 200"
+
+
The optional condition argument determines which internal
- table of responses headers this directive will operate against. Other
- components of the server may have stored their response headers in either
- the table that corresponds to onsuccess
or the table that
- corresponds to always
. "Always" in this context refers to
- whether headers you add will be sent during both a successful and unsucessful
- response, but if your action is a function of an existing header, you
- will have to read on for further complications.
The default value of onsuccess
may need to be changed to
- always
under the circumstances similar to those listed below.
+ table of responses headers this directive will operate against. Despite the
+ name, the default value of onsuccess
does not limit
+ an action to responses with a 2xx status code. Headers set under
+ this condition are still used when, for example, a request is successfully
+ proxied or generated by CGI, even when they have generated a failing status code.
When your action is a function of an existing header, you may need to specify
+ a condition of always
, depending on which internal table the
+ original header was set in. The table that corresponds to always
is
+ used for locally generated error responses as well as successful responses.
Note also that repeating this directive with both conditions makes sense in
some scenarios because always
is not a superset of
onsuccess
with respect to existing headers:
always
is used in the ultimate response.onsuccess
condition.Separately from the condition paramete described above, you + can limit an action based on HTTP status codes for e.g. proxied or CGI + requests. See the example that uses %{REQUEST_STATUS} in the section above.
+The action it performs is determined by the first argument (second argument if a condition is specified). This can be one of the following values:
@@ -394,8 +404,10 @@ Header merge Cache-Control no-store env=NO_STOREExcept in early mode, the
Header
directives are processed just
before the response is sent to the network. These means that it is
- possible to set and/or override most headers, except for those headers
- added by the HTTP header filter, such as Content-Type.