how to set any browser to no keep alive in apache httpd.conf
8,982
If you want to disable HTTP keep-alive for all browsers just set KeepAlive
to off globally.
No sense wasting resources on a BrowserMatch
if you don't have to, but if you really want to use BrowserMatch just compose a regular expression that matches anything. ".*"
is a good one.
Related videos on Youtube
Author by
pablosd
Updated on September 18, 2022Comments
-
pablosd over 1 year
I have the following setting for IE in my httpd.conf:
BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0
I want to apply this to all requests that hit my server.
My httpd.conf section that deals with keep alive looks like this:
# # Timeout: The number of seconds before receives and sends time out. # Timeout 5 # # KeepAlive: Whether or not to allow persistent connections (more than # one request per connection). Set to "Off" to deactivate. # KeepAlive Off # # MaxKeepAliveRequests: The maximum number of requests to allow # during a persistent connection. Set to 0 to allow an unlimited amount. # We recommend you leave this number high, for maximum performance. # MaxKeepAliveRequests 1 # # KeepAliveTimeout: Number of seconds to wait for the next request from the # same client on the same connection. # KeepAliveTimeout 1
How do I do this?
-
adric over 10 yearsYou should be able to do that in the server global or VirtualHost configuration, no?
-
voretaq7 over 10 yearsthat definitely should disable keepalives... It's not being turned on again somewhere else?
-
-
pablosd over 10 yearsKeepAlive was already set to off. Does the client need to do something to stop receiving a connection state of keep-alive after a http get is invoked?
-
voretaq7 over 10 yearsIf
KeepAlive
is Off and not overridden anywhere else then keep-alives should simply not work. I suspect there's more to this that you're not telling us -- what specifically are you trying to accomplish? -
pablosd over 10 yearsI have a client trying to do a get against a service I have. It just returns a few characters. I have posted all the parameters concerning the keep alive in the question above.
-
voretaq7 over 10 yearshmm... I'm not sure Keepalive is your problem, but you certainly appear to have it turned off. You can use my notes above to set HTTP/1.0 for all browsers and see if that helps. If not there may be something else going on...
-
pablosd over 10 yearsI set MaxKeepAliveRequests to 0 and KeepAlive now stays off.