NextJS中文文档 - HttpAgentOptions
在 18 版本之前的 Node.js 中,Next.js 自动使用 undici 对 fetch()
进行填充,并默认启用 HTTP Keep-Alive。
要为服务器端的所有 fetch()
调用禁用 HTTP Keep-Alive,打开/nextjs-cn/并添加
httpAgentOptions` 配置:
js
module.exports = {
httpAgentOptions: {
keepAlive: false,
},
}
1
2
3
4
5
2
3
4
5