gpt4 book ai didi

php - 如何使用 php 覆盖 Apache keep-alive header ?

转载 作者:可可西里 更新时间:2023-10-31 23:32:20 25 4
gpt4 key购买 nike

在我的 httpd.conf 中有:

KeepAliveTimeout 1

我试图在单个 php 脚本(而不是整个服务器)中覆盖 Apache KeepAliveTimeout 设置,所以我有一个 php 脚本:

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

不过好像没什么区别。我仍然得到回应:

Keep-Alive:timeout=1, max=50

有什么解决办法吗?

最佳答案

你不能那样做。它在那里是有正当理由的。

Apache v2.2 Core Features

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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com