コンテンツへスキップ
設定next.config.jshttpAgentOptions

httpAgentOptions

Node.js バージョン18より前では、Next.js は自動的に fetch()undici でポリフィルし、HTTP Keep-Alive をデフォルトで有効にします。

サーバーサイドのすべての fetch() 呼び出しについて HTTP Keep-Alive を無効にするには、next.config.js を開き、httpAgentOptions 設定を追加します。

next.config.js
module.exports = {
  httpAgentOptions: {
    keepAlive: false,
  },
}