在我的 httpd.conf 中有:
KeepAliveTimeout 1
我试图在单个 php 脚本(而不是整个服务器)中覆盖 Apache KeepAliveTimeout 设置,所以我有一个 php 脚本:
header("Keep-Alive: timeout=60, max=100");
不过好像没什么区别。我仍然得到回应:
Keep-Alive:timeout=1, max=50
有什么解决办法吗?
最佳答案
你不能那样做。它在那里是有正当理由的。
KeepAliveTimeout 指令
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.
关于php - 如何使用 php 覆盖 Apache keep-alive header ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15308404/