react-code-dataset / next.js /docs /01-app /03-api-reference /05-config /01-next-config-js /httpAgentOptions.mdx
Download next.js/docs/01-app/03-api-reference/05-config/01-next-config-js/httpAgentOptions.mdx from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 889 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/docs/01-app/03-api-reference/05-config/01-next-config-js/httpAgentOptions.mdx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/docs/01-app/03-api-reference/05-config/01-next-config-js/httpAgentOptions.mdx
-
curl -L -o httpAgentOptions.mdx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/docs/01-app/03-api-reference/05-config/01-next-config-js/httpAgentOptions.mdx
889 Bytes
| --- | |
| title: httpAgentOptions | |
| description: Next.js will automatically use HTTP Keep-Alive by default. Learn more about how to disable HTTP Keep-Alive here. | |
| --- | |
| {/* The content of this doc is shared between the app and pages router. You can use the `<PagesOnly>Content</PagesOnly>` component to add content that is specific to the Pages Router. Any shared content should not be wrapped in a component. */} | |
| In Node.js versions prior to 18, Next.js automatically polyfills `fetch()` with [undici](/docs/architecture/supported-browsers#polyfills) and enables [HTTP Keep-Alive](https://developer.mozilla.org/docs/Web/HTTP/Headers/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 filename="next.config.js" | |
| module.exports = { | |
| httpAgentOptions: { | |
| keepAlive: false, | |
| }, | |
| } | |
| ``` | |