compliance.html.en revision 253547fb9cc7986e84ff68aef076f664fc4169dc
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!--
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe This file is generated from xml source: DO NOT EDIT
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe<title>HTTP Protocol Compliance - Apache HTTP Server</title>
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe<link href="/style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe<link href="/style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe<link href="/style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="/style/css/prettify.css" />
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe<script src="/style/scripts/prettify.js" type="text/javascript">
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe<link href="/images/favicon.ico" rel="shortcut icon" /></head>
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe<p class="menu"><a href="/mod/">Modules</a> | <a href="/mod/quickreference.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="/glossary.html">Glossary</a> | <a href="/sitemap.html">Sitemap</a></p>
3f08db06526d6901aa08c110b5bc7dde6bc39905nd<div class="up"><a href="./"><img title="<-" alt="<-" src="/images/left.gif" /></a></div>
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe<a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">HTTP Server</a> > <a href="http://httpd.apache.org/docs/">Documentation</a> > <a href="./">Version 2.5</a></div><div id="page-content"><div id="preamble"><h1>HTTP Protocol Compliance</h1>
0066eddda7203f6345b56f77d146a759298dc635gryzor<p><span>Available Languages: </span><a href="/en/compliance.html" title="English"> en </a> |
f086b4b402fa9a2fefc7dda85de2a3cc1cd0a654rjung<a href="/fr/compliance.html" hreflang="fr" rel="alternate" title="Fran�ais"> fr </a></p>
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf <p>This document describes the mechanism to set a policy for HTTP
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe protocol compliance for a given URL space by the origin servers or
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe applications behind that URL space.</p>
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe <p>For those who may have received an error message from a rejected
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe policy, and need to know what the policy rejection means and what
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe they might do to fix the error, each policy is described below.</p>
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf<div id="quickview"><ul id="toc"><li><img alt="" src="/images/down.gif" /> <a href="#intro">Enforcing HTTP Protocol Compliance in Apache 2</a></li>
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe<li><img alt="" src="/images/down.gif" /> <a href="#policyconditional">Conditional Request Policy</a></li>
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe<li><img alt="" src="/images/down.gif" /> <a href="#policylength">Content-Length Policy</a></li>
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe<li><img alt="" src="/images/down.gif" /> <a href="#policytype">Content-Type Policy</a></li>
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe<li><img alt="" src="/images/down.gif" /> <a href="#policykeepalive">Keepalive Policy</a></li>
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf<li><img alt="" src="/images/down.gif" /> <a href="#policymaxage">Freshness Lifetime / Maxage Policy</a></li>
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe<li><img alt="" src="/images/down.gif" /> <a href="#policynocache">No Cache Policy</a></li>
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe<li><img alt="" src="/images/down.gif" /> <a href="#policyvalidation">Validation Policy</a></li>
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe<li><img alt="" src="/images/down.gif" /> <a href="#policyvary">Vary Header Policy</a></li>
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe<li><img alt="" src="/images/down.gif" /> <a href="#policyversion">Protocol Version Policy</a></li>
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe</ul><h3>See also</h3><ul class="seealso"><li><a href="filter.html">Filters</a></li></ul><ul class="seealso"><li><a href="#comments_section">Comments</a></li></ul></div>
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe<h2><a name="intro" id="intro">Enforcing HTTP Protocol Compliance in Apache 2</a></h2>
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf <table class="related"><tr><th>Related Modules</th><th>Related Directives</th></tr><tr><td><ul><li><code class="module"><a href="/mod/mod_policy.html">mod_policy</a></code></li></ul></td><td><ul><li><code class="directive"><a href="/mod/mod_policy.html#policyconditional">PolicyConditional</a></code></li><li><code class="directive"><a href="/mod/mod_policy.html#policylength">PolicyLength</a></code></li><li><code class="directive"><a href="/mod/mod_policy.html#policykeepalive">PolicyKeepalive</a></code></li><li><code class="directive"><a href="/mod/mod_policy.html#policytype">PolicyType</a></code></li><li><code class="directive"><a href="/mod/mod_policy.html#policyvary">PolicyVary</a></code></li><li><code class="directive"><a href="/mod/mod_policy.html#policyvalidation">PolicyValidation</a></code></li><li><code class="directive"><a href="/mod/mod_policy.html#policynocache">PolicyNocache</a></code></li><li><code class="directive"><a href="/mod/mod_policy.html#policymaxage">PolicyMaxage</a></code></li><li><code class="directive"><a href="/mod/mod_policy.html#policyversion">PolicyVersion</a></code></li></ul></td></tr></table>
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe <p>The HTTP protocol follows the <strong>robustness principle</strong>
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe as described in <a href="http://tools.ietf.org/html/rfc1122">RFC1122</a>,
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe which states <strong>"Be liberal in what you accept, and conservative in
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe what you send"</strong>. As a result of this principle, HTTP clients will
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe compensate for and recover from incorrect or misconfigured responses, or
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe responses that are uncacheable.</p>
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe <p>As a website is scaled up to face greater and greater traffic loads,
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe suboptimal or misconfigured applications or server configurations can
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe threaten both the stability and scalability of the website, as well as
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe the hosting costs associated with it. A website can also scale up to face
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe greater configuration complexity, and it can be increasingly difficult to
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe detect and keep track of suboptimally configured URL spaces on a given
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe server.</p>
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe <p>Eventually a point is reached where the principle "conservative in
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe what you send" needs to be enforced by the server administrator.</p>
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe <p>The <code class="module"><a href="/mod/mod_policy.html">mod_policy</a></code> module provides a set of filters
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe which can be applied to a server, allowing key features of the HTTP
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe protocol to be explicitly tested, and non compliant responses logged as
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe warnings, or rejected outright as an error. Each filter can be applied
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe separately, allowing the administrator to pick and choose which policies
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe should be enforced depending on the circumstances of their environment.
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe <p>The filters might be placed in testing and staging environments for
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe the benefit of application and website developers, or may be applied
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe to production servers to protect infrastructure from systems outside
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe the administrator's direct control.</p>
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf <img src="images/compliance-reverse-proxy.png" width="666" height="239" alt="Enforcing HTTP protocol compliance for an application server" />
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe <p>In the above example, an Apache httpd server has been placed between
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe the application server and the internet at large, and configured to cache
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf responses from the application server. The <code class="module"><a href="/mod/mod_policy.html">mod_policy</a></code>
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe filters have been added to enforce support for cacheable content and
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe conditional requests, ensuring that both <code class="module"><a href="/mod/mod_cache.html">mod_cache</a></code> and
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf public caches on the internet are fully able to cache content created
27dcd8d81085fd60aadcd8a9bad35a607b26b758nilgun by the restful application server efficiently.</p>
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe <img src="images/compliance-static.png" width="469" height="239" alt="Enforcing HTTP protocol compliance in a static server" />
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe <p>In the above simpler example, a static server serving highly cacheable
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe content has a set of policies applied to ensure that the server configuration
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe conforms to a minimum level of compliance.</p>
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe </div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe<h2><a name="policyconditional" id="policyconditional">Conditional Request Policy</a></h2>
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe <table class="related"><tr><th>Related Modules</th><th>Related Directives</th></tr><tr><td><ul><li><code class="module"><a href="/mod/mod_policy.html">mod_policy</a></code></li></ul></td><td><ul><li><code class="directive"><a href="/mod/mod_policy.html#policyconditional">PolicyConditional</a></code></li></ul></td></tr></table>
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe <p>This policy will be rejected if the server does not correctly respond
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe to a conditional request with the appropriate status code.</p>
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe <p>Conditional requests form the mechanism by which an HTTP cache makes
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe stale content fresh again, and particularly for content with short freshness
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf lifetimes, lack of support for conditional requests can add avoidable load
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe to the server.</p>
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe <p>Most specifically, the existence of any of following headers in the
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe request makes the request conditional:</p>
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe <dd>If the provided ETag in the <code>If-Match</code> header does not match
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe the ETag of the response, the server should return
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe <code>412 Precondition Failed</code>. Full details of how to handle an
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.24">
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe <dd>If the provided ETag in the <code>If-None-Match</code> header matches
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe the ETag of the response, the server should return either
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe <code>304 Not Modified</code> for GET/HEAD requests, or
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe <code>412 Precondition Failed</code> for other methods. Full details of how
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe to handle an <code>If-None-Match</code> header can be found in
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.26">
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe <dd>If the provided date in the <code>If-Modified-Since</code> header is
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe older than the <code>Last-Modified</code> header of the response, the server
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe should return <code>304 Not Modified</code>. Full details of how to handle an
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.25">
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe <dd>If the provided date in the <code>If-Modified-Since</code> header is
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe newer than the <code>Last-Modified</code> header of the response, the server
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe should return <code>412 Precondition Failed</code>. Full details of how to
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe handle an <code>If-Unmodified-Since</code> header can be found in
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.28">
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe <dd>If the provided ETag or date in the <code>If-Range</code> header matches
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe the ETag or Last-Modified of the response, and a valid <code>Range</code>
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf is present, the server should return
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe <code>206 Partial Response</code>. Full details of how to handle an
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.27">
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe <p>If the response is detected to have been successful (a 2xx response),
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe but was conditional and one of the responses above was expected instead,
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe this policy will be rejected. Responses that indicate a redirect or a
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe failure of some kind (3xx, 4xx, 5xx) will be ignored by this policy.</p>
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe <p>This policy is implemented by the <strong>POLICY_CONDITIONAL</strong>
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe filter.</p>
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe </div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe<h2><a name="policylength" id="policylength">Content-Length Policy</a></h2>
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe <table class="related"><tr><th>Related Modules</th><th>Related Directives</th></tr><tr><td><ul><li><code class="module"><a href="/mod/mod_policy.html">mod_policy</a></code></li></ul></td><td><ul><li><code class="directive"><a href="/mod/mod_policy.html#policylength">PolicyLength</a></code></li></ul></td></tr></table>
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe <p>This policy will be rejected if the server response does not contain
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe <p>There are a number of ways of determining the length of a response
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe body, described in full in
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec4.4">
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe <p>When the <code>Content-Length</code> header is present, the size of
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe the body is declared at the start of the response. If this information
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe is missing, an HTTP cache might choose to ignore the response, as it
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe does not know in advance whether the response will fit within the
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe cache's defined limits.</p>
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe <p>HTTP/1.1 defines the <code>Transfer-Encoding</code> header as an
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe alternative to <code>Content-Length</code>, allowing the end of the
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe response to be indicated to the client without the client having to
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe know the length beforehand. However, when HTTP/1.0 requests are
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe processed, and no <code>Content-Length</code> is specified, the only
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe mechanism available to the server to indicate the end of the request
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe is to drop the connection. In an environment containing load
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe balancers, this can cause the keepalive mechanism to be bypassed.
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe <p>If the response is detected to have been successful (a 2xx response),
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe and has a response body (this excludes <code>204 No Content</code>), and
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe the <code>Content-Length</code> header is missing, this policy will be
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe rejected. Responses that indicate a redirect or a failure of some kind
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe (3xx, 4xx, 5xx) will be ignored by this policy.</p>
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf <div class="warning">It should be noted that some modules, such as
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe <code class="module"><a href="/mod/mod_proxy.html">mod_proxy</a></code>, add their own <code>Content-Length</code>
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe header should the response be small enough for it to have been possible
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe to read the response lacking such a header in one go. This may cause
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe small responses to pass this policy, while larger responses may
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe fail for the same URL.</div>
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe <p>This policy is implemented by the <strong>POLICY_LENGTH</strong>
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe filter.</p>
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe </div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe<h2><a name="policytype" id="policytype">Content-Type Policy</a></h2>
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe <table class="related"><tr><th>Related Modules</th><th>Related Directives</th></tr><tr><td><ul><li><code class="module"><a href="/mod/mod_policy.html">mod_policy</a></code></li></ul></td><td><ul><li><code class="directive"><a href="/mod/mod_policy.html#policytype">PolicyType</a></code></li></ul></td></tr></table>
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe <p>This policy will be rejected if the server response does not contain
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe an explicit and syntactically correct <code>Content-Type</code> header
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe that matches the server defined pattern.</p>
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe <p>The media type of the body is placed in the <code>Content-Type</code>
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf header, and the format of the header is described in full in
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec3.7">
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe <p>A syntactically valid content type might look as follows:</p>
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe # invalid<br />
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe Content-Type: foo<br />
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe # blank<br />
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe Content-Type:
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe <p>The server administrator has the option to restrict the policy to one
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe or more specific types, or could specify a general wildcard type such as
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe <p>This policy is implemented by the <strong>POLICY_TYPE</strong>
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe filter.</p>
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe </div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe<h2><a name="policykeepalive" id="policykeepalive">Keepalive Policy</a></h2>
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe <table class="related"><tr><th>Related Modules</th><th>Related Directives</th></tr><tr><td><ul><li><code class="module"><a href="/mod/mod_policy.html">mod_policy</a></code></li></ul></td><td><ul><li><code class="directive"><a href="/mod/mod_policy.html#policykeepalive">PolicyKeepalive</a></code></li></ul></td></tr></table>
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe <p>This policy will be rejected if the server response does not contain
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe <p>There are a number of ways of determining the length of a response
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe body, described in full in
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec4.4">
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe <p>When the <code>Content-Length</code> header is present, the size of
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe the body is declared at the start of the response. HTTP/1.1 defines the
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe <code>Transfer-Encoding</code> header as an alternative to
0066eddda7203f6345b56f77d146a759298dc635gryzor <code>Content-Length</code>, allowing the end of the response to be
f086b4b402fa9a2fefc7dda85de2a3cc1cd0a654rjung indicated to the client without the client having to know the length
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe beforehand. In the absence of these two mechanisms, the only way for
9c1260efa52c82c2a58e5b5f20cd6902563d95f5rbowen a server to indicate the end of the request is to drop the connection.
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe In an environment containing load balancers, this can cause the keepalive
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe mechanism to be bypassed.
<table class="related"><tr><th>Related Modules</th><th>Related Directives</th></tr><tr><td><ul><li><code class="module"><a href="/mod/mod_policy.html">mod_policy</a></code></li></ul></td><td><ul><li><code class="directive"><a href="/mod/mod_policy.html#policymaxage">PolicyMaxage</a></code></li></ul></td></tr></table>
<table class="related"><tr><th>Related Modules</th><th>Related Directives</th></tr><tr><td><ul><li><code class="module"><a href="/mod/mod_policy.html">mod_policy</a></code></li></ul></td><td><ul><li><code class="directive"><a href="/mod/mod_policy.html#policynocache">PolicyNocache</a></code></li></ul></td></tr></table>
<table class="related"><tr><th>Related Modules</th><th>Related Directives</th></tr><tr><td><ul><li><code class="module"><a href="/mod/mod_policy.html">mod_policy</a></code></li></ul></td><td><ul><li><code class="directive"><a href="/mod/mod_policy.html#policyvalidation">PolicyValidation</a></code></li></ul></td></tr></table>
<table class="related"><tr><th>Related Modules</th><th>Related Directives</th></tr><tr><td><ul><li><code class="module"><a href="/mod/mod_policy.html">mod_policy</a></code></li></ul></td><td><ul><li><code class="directive"><a href="/mod/mod_policy.html#policyvary">PolicyVary</a></code></li></ul></td></tr></table>
<table class="related"><tr><th>Related Modules</th><th>Related Directives</th></tr><tr><td><ul><li><code class="module"><a href="/mod/mod_policy.html">mod_policy</a></code></li></ul></td><td><ul><li><code class="directive"><a href="/mod/mod_policy.html#policyversion">PolicyVersion</a></code></li></ul></td></tr></table>
<p><span>Available Languages: </span><a href="/en/compliance.html" title="English"> en </a> |
</div><div class="top"><a href="#page-header"><img src="/images/up.gif" alt="top" /></a></div><div class="section"><h2><a id="comments_section" name="comments_section">Comments</a></h2><div class="warning"><strong>Notice:</strong><br />This is not a Q&A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our <a href="http://httpd.apache.org/lists.html">mailing lists</a>.</div>
var comments_identifier = 'http://httpd.apache.org/docs/trunk/compliance.html';
if (w.location.hostname.toLowerCase() == "httpd.apache.org") {
d.write('<div id="comments_thread"><\/div>');
var s = d.createElement('script');
s.type = 'text/javascript';
s.async = true;
s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier;
(d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s);
d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>');
<p class="apache">Copyright 2013 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
<p class="menu"><a href="/mod/">Modules</a> | <a href="/mod/quickreference.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="/glossary.html">Glossary</a> | <a href="/sitemap.html">Sitemap</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!--