Unverified Commit 0c85f8aa authored by Delba de Oliveira's avatar Delba de Oliveira Committed by GitHub

Docs: Add notes that revalidation is not available in the Edge runtime / only Node.js (#54338)

Fixes: https://vercel.slack.com/archives/C03S9JCH2Q5/p1692261964220369
parent 1f999b6f
...@@ -115,6 +115,8 @@ If you have multiple fetch requests in a statically rendered route, and each has ...@@ -115,6 +115,8 @@ If you have multiple fetch requests in a statically rendered route, and each has
Learn more about [time-based revalidation](/docs/app/building-your-application/caching#time-based-revalidation). Learn more about [time-based revalidation](/docs/app/building-your-application/caching#time-based-revalidation).
> **Good to know:** Revalidation only works with the [Node.js runtime](docs/app/building-your-application/rendering/edge-and-nodejs-runtimes#nodejs-runtime) (default).
#### On-demand Revalidation #### On-demand Revalidation
Data can be revalidated on-demand by path ([`revalidatePath`](/docs/app/api-reference/functions/revalidatePath)) or by cache tag ([`revalidateTag`](/docs/app/api-reference/functions/revalidateTag)) inside a Route Handler or a Server Action. Data can be revalidated on-demand by path ([`revalidatePath`](/docs/app/api-reference/functions/revalidatePath)) or by cache tag ([`revalidateTag`](/docs/app/api-reference/functions/revalidateTag)) inside a Route Handler or a Server Action.
......
...@@ -27,6 +27,7 @@ There are many considerations to make when choosing a runtime. This table shows ...@@ -27,6 +27,7 @@ There are many considerations to make when choosing a runtime. This table shows
| Security | Normal | High | High | | Security | Normal | High | High |
| Latency | Normal | Low | Lowest | | Latency | Normal | Low | Lowest |
| npm Packages | All | All | A smaller subset | | npm Packages | All | All | A smaller subset |
| Revalidation | Yes | Yes | No |
### Edge Runtime ### Edge Runtime
......
...@@ -118,6 +118,8 @@ export const revalidate = false ...@@ -118,6 +118,8 @@ export const revalidate = false
- **`0`**: Ensure a layout or page is always [dynamically rendered](/docs/app/building-your-application/rendering/static-and-dynamic#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/static-and-dynamic#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.
> **Good to know**: The `revalidate` option is only available when using the [Node.js Runtime](/https://nextjs.org/docs/app/building-your-application/rendering/edge-and-nodejs-runtimes#nodejs-runtime). This means using the `revalidate` option with `runtime = 'edge'` will not work.
#### Revalidation Frequency #### Revalidation Frequency
- The lowest `revalidate` across each layout and page of a single route will determine the revalidation frequency of the _entire_ route. This ensures that child pages are revalidated as frequently as their parent layouts. - The lowest `revalidate` across each layout and page of a single route will determine the revalidation frequency of the _entire_ route. This ensures that child pages are revalidated as frequently as their parent layouts.
......
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