You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by co...@apache.org on 2014/04/10 21:34:40 UTC
svn commit: r1586444 - /httpd/httpd/trunk/docs/manual/mod/mod_headers.html.en
Author: covener
Date: Thu Apr 10 19:34:40 2014
New Revision: 1586444
URL: http://svn.apache.org/r1586444
Log:
xforms
Modified:
httpd/httpd/trunk/docs/manual/mod/mod_headers.html.en
Modified: httpd/httpd/trunk/docs/manual/mod/mod_headers.html.en
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/mod_headers.html.en?rev=1586444&r1=1586443&r2=1586444&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/mod/mod_headers.html.en (original)
+++ httpd/httpd/trunk/docs/manual/mod/mod_headers.html.en Thu Apr 10 19:34:40 2014
@@ -194,6 +194,12 @@ Header merge Cache-Control no-store env=
<pre class="prettyprint lang-config">Header set Set-Cookie testcookie "expr=-z %{req:Cookie}"</pre>
</li>
+ <li>
+ Append a Caching header for responses with a HTTP status code of 200
+ <pre class="prettyprint lang-config">Header append Cache-Control s-maxage=600 "expr=%{REQUEST_STATUS} == 200"</pre>
+
+ </li>
+
</ol>
</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
@@ -216,22 +222,22 @@ Header merge Cache-Control no-store env=
modified.</p>
<p> The optional <var>condition</var> 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 <code>onsuccess</code> or the table that
- corresponds to <code>always</code>. "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.</p>
-
- <p> The default value of <code>onsuccess</code> may need to be changed to
- <code>always</code> under the circumstances similar to those listed below.
+ table of responses headers this directive will operate against. Despite the
+ name, the default value of <code>onsuccess</code> does <em>not</em> limit
+ an <var>action</var> to responses with a 2xx status code. Headers set under
+ this condition are still used when, for example, a request is <em>successfully</em>
+ proxied or generated by CGI, even when they have generated a failing status code.</p>
+
+ <p>When your action is a function of an existing header, you may need to specify
+ a condition of <code>always</code>, depending on which internal table the
+ original header was set in. The table that corresponds to <code>always</code> 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 <code>always</code> is not a superset of
<code>onsuccess</code> with respect to existing headers:</p>
<ul>
- <li> You're adding a header to a non-success (non-2xx) response, such
+ <li> You're adding a header to a locally generated non-success (non-2xx) response, such
as a redirect, in which case only the table corresponding to
<code>always</code> is used in the ultimate response.</li>
<li> You're modifying or removing a header generated by a CGI script,
@@ -242,6 +248,10 @@ Header merge Cache-Control no-store env=
<code>onsuccess</code> condition.</li>
</ul>
+ <p>Separately from the <var>condition</var> 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.</p>
+
<p>The action it performs is determined by the first
argument (second argument if a <var>condition</var> is specified).
This can be one of the following values:</p>
@@ -394,8 +404,10 @@ Header merge Cache-Control no-store env=
<p>Except in <a href="#early">early</a> mode, the
<code class="directive">Header</code> 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.</p>
+ possible to set and/or override most headers, except for some headers
+ added by the HTTP header filter. Prior to 2.2.12, it was not possible
+ to change the Content-Type header with this directive.</p>
+
</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>