A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config below:

File-system conventions: Route Segment Config

Route Segment Config

The options outlined on this page are disabled if the dynamicIO flag is on, and will eventually be deprecated in the future.

The Route Segment options allows you to configure the behavior of a Page, Layout, or Route Handler by directly exporting the following variables:

Option Type Default experimental_ppr boolean dynamic 'auto' | 'force-dynamic' | 'error' | 'force-static' 'auto' dynamicParams boolean true revalidate false | 0 | number false fetchCache 'auto' | 'default-cache' | 'only-cache' | 'force-cache' | 'force-no-store' | 'default-no-store' | 'only-no-store' 'auto' runtime 'nodejs' | 'edge' 'nodejs' preferredRegion 'auto' | 'global' | 'home' | string | string[] 'auto' maxDuration number Set by deployment platform Options experimental_ppr

Enable Partial Prerendering (PPR) for a layout or page.

export const experimental_ppr = true
// true | false
dynamic

Change the dynamic behavior of a layout or page to fully static or fully dynamic.

export const dynamic = 'auto'
// 'auto' | 'force-dynamic' | 'error' | 'force-static'

Good to know: The new model in the app directory favors granular caching control at the fetch request level over the binary all-or-nothing model of getServerSideProps and getStaticProps at the page-level in the pages directory. The dynamic option is a way to opt back in to the previous model as a convenience and provides a simpler migration path.

Good to know:

dynamicParams

Control what happens when a dynamic segment is visited that was not generated with generateStaticParams.

export const dynamicParams = true // true | false,

Good to know:

revalidate

Set the default revalidation time for a layout or page. This option does not override the revalidate value set by individual fetch requests.

export const revalidate = false
// false | 0 | number

Good to know:

Revalidation Frequency fetchCache This is an advanced option that should only be used if you specifically need to override the default behavior.

By default, Next.js will cache any fetch() requests that are reachable before any Dynamic APIs are used and will not cache fetch requests that are discovered after Dynamic APIs are used.

fetchCache allows you to override the default cache option of all fetch requests in a layout or page.

export const fetchCache = 'auto'
// 'auto' | 'default-cache' | 'only-cache'
// 'force-cache' | 'force-no-store' | 'default-no-store' | 'only-no-store'
Cross-route segment behavior runtime

We recommend using the Node.js runtime for rendering your application, and the Edge runtime for Middleware.

export const runtime = 'nodejs'
// 'nodejs' | 'edge'
preferredRegion
export const preferredRegion = 'auto'
// 'auto' | 'global' | 'home' | ['iad1', 'sfo1']

Support for preferredRegion, and regions supported, is dependent on your deployment platform.

Good to know:

maxDuration

By default, Next.js does not limit the execution of server-side logic (rendering a page or handling an API). Deployment platforms can use maxDuration from the Next.js build output to add specific execution limits.

Note: This setting requires Next.js 13.4.10 or higher.

export const maxDuration = 5

Good to know:

generateStaticParams

The generateStaticParams function can be used in combination with dynamic route segments to define the list of route segment parameters that will be statically generated at build time instead of on-demand at request time.

See the API reference for more details.

Version History Version v15.0.0-RC export const runtime = "experimental-edge" deprecated. A codemod is available.

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4