1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML><HEAD>
<TITLE>Apache Keep-Alive Support</TITLE>
</HEAD>
<!-- Background white, links blue (unvisited), navy (visited), red (active) -->
<BODY
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#000080"
ALINK="#FF0000"
>
<DIV ALIGN="CENTER">
<IMG SRC="images/sub.gif" ALT="[APACHE DOCUMENTATION]">
<H3>
Apache HTTP Server Version 1.3
</H3>
</DIV>
<H1 ALIGN="CENTER">Apache Keep-Alive Support</H1>
<HR>
<H2>What is Keep-Alive?</H2>
The Keep-Alive extension to HTTP, as defined by the
<CODE>HTTP/1.1</CODE> draft, allows persistent connections. These
long-lived HTTP sessions allow multiple requests to be send over the
same TCP connection, and in some cases have been shown to result in an
almost 50% speedup in latency times for HTML documents with lots of
images.
<H2>Enabling Keep-Alive Support</H2>
Apache 1.1 comes with Keep-Alive support on by default, however there
are some directives you can use to modify Apache's behavior:
<P><STRONG>Note</STRONG>: Apache 1.2 uses a different syntax for the <A
HREF="mod/core.html#keepalive">KeepAlive</A> directive.</P>
<H3>KeepAlive</H3>
<A
HREF="mod/directive-dict.html#Syntax"
REL="Help"
><STRONG>Syntax:</STRONG></A> KeepAlive <EM>max-requests</EM><BR>
<A
HREF="mod/directive-dict.html#Default"
REL="Help"
><STRONG>Default:</STRONG></A> <CODE>KeepAlive 5</CODE><BR>
<A
HREF="mod/directive-dict.html#Context"
REL="Help"
><STRONG>Context:</STRONG></A> server config<BR>
<A
HREF="mod/directive-dict.html#Status"
REL="Help"
><STRONG>Status:</STRONG></A> Core<P>
This directive enables Keep-Alive support. Set <EM>max-requests</EM>
to the maximum number of requests you want Apache to entertain per
connection. A limit is imposed to prevent a client from hogging your
server resources. Set this to <CODE>0</CODE> to disable support.
<H3>KeepAliveTimeout</H3>
<A
HREF="mod/directive-dict.html#Syntax"
REL="Help"
><STRONG>Syntax:</STRONG></A> KeepAliveTimeout <EM>seconds</EM><BR>
<A
HREF="mod/directive-dict.html#Default"
REL="Help"
><STRONG>Default:</STRONG></A> <CODE>KeepAliveTimeout 15</CODE><BR>
<A
HREF="mod/directive-dict.html#Context"
REL="Help"
><STRONG>Context:</STRONG></A> server config<BR>
<A
HREF="mod/directive-dict.html#Status"
REL="Help"
><STRONG>Status:</STRONG></A> Core<P>
The number of seconds Apache will wait for a subsequent request before
closing the connection. Once a request has been received, the timeout
value specified by the <A
HREF="mod/core.html#timeout"><CODE>Timeout</CODE></A> directive
applies.
<H2>When Keep-Alive Is Used</H2>
In order for Keep-Alive support to be used, first the browser must
support it. Many current browsers, including Netscape Navigator 2.0,
and Spyglass Mosaic-based browsers (including Microsoft Internet
Explorer) do. Note, however, that some Windows 95-based browsers misbehave
with Keep-Alive-supporting servers; they may occasionally hang on a
connect. This has been observed with several Windows browsers, and occurs
when connecting to any Keep-Alive server, not just Apache. Netscape 3.0b5
and later versions are known to work around this problem.
<P>However, Keep-Alive support only is active with files where the
length is known beforehand. This means that most CGI scripts,
server-side included files and directory listings will not use
the Keep-Alive protocol. While this should be completely transparent
to the end user, it is something the web-master may want to keep in mind.</P>
<HR>
<H3 ALIGN="CENTER">
Apache HTTP Server Version 1.3
</H3>
<A HREF="./"><IMG SRC="images/index.gif" ALT="Index"></A>
</BODY>
</HTML>
|