Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to override Apache keep-alive header using php?

Tags:

http

php

apache

web

in my httpd.conf there is:

KeepAliveTimeout 1

I'm trying to override Apache KeepAliveTimeout setting in a single php script (not in the entire server) so I have a php script with:

header("Keep-Alive: timeout=60, max=100"); 

but it doesn't seem to make any difference. still I get in the response:

Keep-Alive:timeout=1, max=50

any ideas how to solve this?

like image 939
David Avatar asked Nov 04 '22 02:11

David


1 Answers

You can't do that. It's there in place for a valid reason.

Apache v2.2 Core Features

KeepAliveTimeout Directive

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 Timeout directive applies.

Setting KeepAliveTimeout to a high value may cause performance problems in heavily loaded servers. The higher the timeout, the more server processes will be kept occupied waiting on connections with idle clients.

like image 179
जलजनक Avatar answered Nov 09 '22 11:11

जलजनक