httpAgentOptions
Node.js バージョン18より前では、Next.js は自動的に fetch()
を undici でポリフィルし、デフォルトで HTTP Keep-Alive を有効にします。
サーバーサイドのすべての fetch()
呼び出しで HTTP Keep-Alive を無効にするには、next.config.js
を開き、httpAgentOptions
設定を追加します:
module.exports = {
httpAgentOptions: {
keepAlive: false,
},
}