Back to Next Js

httpAgentOptions

docs/01-app/03-api-reference/05-config/01-next-config-js/httpAgentOptions.mdx

16.2.5483 B
Original Source

In Node.js versions prior to 18, Next.js automatically polyfills fetch() with undici and enables HTTP Keep-Alive by default.

To disable HTTP Keep-Alive for all fetch() calls on the server-side, open next.config.js and add the httpAgentOptions config:

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