Skip to content

Latest commit

 

History

History
26 lines (20 loc) · 866 Bytes

disabling-http-keep-alive.md

File metadata and controls

26 lines (20 loc) · 866 Bytes
description
Next.js will automatically use HTTP Keep-Alive by default. Learn more about how to disable HTTP Keep-Alive here.

Disabling HTTP Keep-Alive

Next.js automatically polyfills fetch() in the Node.js environment with node-fetch 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:

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

Related