Unverified Commit b262ed0b authored by 조계진's avatar 조계진 Committed by GitHub

docs: fix typo in `route-segment-config.mdx` (#63362)

I accidentally closed [this
PR](https://github.com/vercel/next.js/pull/63307), so I opened it again.

- adjust the position of `(default)`
- change from hyphen to colon
- change the order of comments in code blocks so that the default option
`'nodejs'` comes first.
- change `nodejs`, `edge` to `'nodejs'`, `'edge'` like other string
segment options.

---------
Co-authored-by: 's avatarSam Ko <sam@vercel.com>
parent 0ab8c209
...@@ -110,7 +110,7 @@ export const revalidate = false ...@@ -110,7 +110,7 @@ export const revalidate = false
// false | 0 | number // false | 0 | number
``` ```
- **`false`**: (default) The default heuristic to cache any `fetch` requests that set their `cache` option to `'force-cache'` or are discovered before a [dynamic function](/docs/app/building-your-application/rendering/server-components#server-rendering-strategies#dynamic-functions) is used. Semantically equivalent to `revalidate: Infinity` which effectively means the resource should be cached indefinitely. It is still possible for individual `fetch` requests to use `cache: 'no-store'` or `revalidate: 0` to avoid being cached and make the route dynamically rendered. Or set `revalidate` to a positive number lower than the route default to increase the revalidation frequency of a route. - **`false`** (default): The default heuristic to cache any `fetch` requests that set their `cache` option to `'force-cache'` or are discovered before a [dynamic function](/docs/app/building-your-application/rendering/server-components#server-rendering-strategies#dynamic-functions) is used. Semantically equivalent to `revalidate: Infinity` which effectively means the resource should be cached indefinitely. It is still possible for individual `fetch` requests to use `cache: 'no-store'` or `revalidate: 0` to avoid being cached and make the route dynamically rendered. Or set `revalidate` to a positive number lower than the route default to increase the revalidation frequency of a route.
- **`0`**: Ensure a layout or page is always [dynamically rendered](/docs/app/building-your-application/rendering/server-components#dynamic-rendering) even if no dynamic functions or uncached data fetches are discovered. This option changes the default of `fetch` requests that do not set a `cache` option to `'no-store'` but leaves `fetch` requests that opt into `'force-cache'` or use a positive `revalidate` as is. - **`0`**: Ensure a layout or page is always [dynamically rendered](/docs/app/building-your-application/rendering/server-components#dynamic-rendering) even if no dynamic functions or uncached data fetches are discovered. This option changes the default of `fetch` requests that do not set a `cache` option to `'no-store'` but leaves `fetch` requests that opt into `'force-cache'` or use a positive `revalidate` as is.
- **`number`**: (in seconds) Set the default revalidation frequency of a layout or page to `n` seconds. - **`number`**: (in seconds) Set the default revalidation frequency of a layout or page to `n` seconds.
...@@ -142,7 +142,7 @@ export const fetchCache = 'auto' ...@@ -142,7 +142,7 @@ export const fetchCache = 'auto'
// 'force-cache' | 'force-no-store' | 'default-no-store' | 'only-no-store' // 'force-cache' | 'force-no-store' | 'default-no-store' | 'only-no-store'
``` ```
- **`'auto'`** (default)- The default option to cache `fetch` requests before dynamic functions with the `cache` option they provide and not cache `fetch` requests after dynamic functions. - **`'auto'`** (default): The default option to cache `fetch` requests before dynamic functions with the `cache` option they provide and not cache `fetch` requests after dynamic functions.
- **`'default-cache'`**: Allow any `cache` option to be passed to `fetch` but if no option is provided then set the `cache` option to `'force-cache'`. This means that even `fetch` requests after dynamic functions are considered static. - **`'default-cache'`**: Allow any `cache` option to be passed to `fetch` but if no option is provided then set the `cache` option to `'force-cache'`. This means that even `fetch` requests after dynamic functions are considered static.
- **`'only-cache'`**: Ensure all `fetch` requests opt into caching by changing the default to `cache: 'force-cache'` if no option is provided and causing an error if any `fetch` requests use `cache: 'no-store'`. - **`'only-cache'`**: Ensure all `fetch` requests opt into caching by changing the default to `cache: 'force-cache'` if no option is provided and causing an error if any `fetch` requests use `cache: 'no-store'`.
- **`'force-cache'`**: Ensure all `fetch` requests opt into caching by setting the `cache` option of all `fetch` requests to `'force-cache'`. - **`'force-cache'`**: Ensure all `fetch` requests opt into caching by setting the `cache` option of all `fetch` requests to `'force-cache'`.
...@@ -166,16 +166,16 @@ export const fetchCache = 'auto' ...@@ -166,16 +166,16 @@ export const fetchCache = 'auto'
```tsx filename="layout.tsx | page.tsx | route.ts" switcher ```tsx filename="layout.tsx | page.tsx | route.ts" switcher
export const runtime = 'nodejs' export const runtime = 'nodejs'
// 'edge' | 'nodejs' // 'nodejs' | 'edge'
``` ```
```js filename="layout.js | page.js | route.js" switcher ```js filename="layout.js | page.js | route.js" switcher
export const runtime = 'nodejs' export const runtime = 'nodejs'
// 'edge' | 'nodejs' // 'nodejs' | 'edge'
``` ```
- **`nodejs`** (default) - **`'nodejs'`** (default)
- **`edge`** - **`'edge'`**
Learn more about the [Edge and Node.js runtimes](/docs/app/building-your-application/rendering/edge-and-nodejs-runtimes). Learn more about the [Edge and Node.js runtimes](/docs/app/building-your-application/rendering/edge-and-nodejs-runtimes).
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment