mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
Closes: https://linear.app/vercel/issue/DOC-6221/nextjs-split-route-segments-files-in-preparation-for-instant
25 lines
869 B
Plaintext
25 lines
869 B
Plaintext
---
|
|
title: maxDuration
|
|
description: API reference for the maxDuration route segment config option.
|
|
---
|
|
|
|
The `maxDuration` option allows you to set the maximum execution time (in seconds) for server-side logic in a route segment. Deployment platforms can use `maxDuration` from the Next.js build output to add specific execution limits.
|
|
|
|
```tsx filename="layout.tsx | page.tsx | route.ts" switcher
|
|
export const maxDuration = 5
|
|
```
|
|
|
|
```js filename="layout.js | page.js | route.js" switcher
|
|
export const maxDuration = 5
|
|
```
|
|
|
|
## Server Actions
|
|
|
|
If using [Server Actions](/docs/app/getting-started/mutating-data), set the `maxDuration` at the page level to change the default timeout of all Server Actions used on the page.
|
|
|
|
## Version History
|
|
|
|
| Version | Changes |
|
|
| ---------- | ------------------------- |
|
|
| `v13.4.10` | `maxDuration` introduced. |
|