Unverified Commit 34f675a5 authored by Sam Ko's avatar Sam Ko Committed by GitHub

docs(unstable_cache): add data cache mentions (#65342)

## Why?

There is no mention that Data Cache is being used for the
`unstable_cache` API in our documentation.

Closes NEXT-3319
parent d89c2e0b
...@@ -369,7 +369,7 @@ The cache is stored in the browser's temporary memory. Two factors determine how ...@@ -369,7 +369,7 @@ The cache is stored in the browser's temporary memory. Two factors determine how
While a page refresh will clear **all** cached segments, the automatic invalidation period only affects the individual segment from the time it was prefetched. While a page refresh will clear **all** cached segments, the automatic invalidation period only affects the individual segment from the time it was prefetched.
> **Note**: There is [experimental support](/docs/app/api-reference/next-config-js/staleTimes) for configuring these values as of v14.2.0-canary.53. > **Note**: There is [experimental support](/docs/app/api-reference/next-config-js/staleTimes) for configuring these values as of This configuration option is available as of [v14.2.0](https://github.com/vercel/next.js/releases/tag/v14.2.0).
### Invalidation ### Invalidation
...@@ -421,7 +421,7 @@ The following table provides an overview of how different Next.js APIs affect ca ...@@ -421,7 +421,7 @@ The following table provides an overview of how different Next.js APIs affect ca
| [`headers`, `searchParams`](#dynamic-functions) | | Opt out | | | | [`headers`, `searchParams`](#dynamic-functions) | | Opt out | | |
| [`generateStaticParams`](#generatestaticparams) | | Cache | | | | [`generateStaticParams`](#generatestaticparams) | | Cache | | |
| [`React.cache`](#react-cache-function) | | | | Cache | | [`React.cache`](#react-cache-function) | | | | Cache |
| [`unstable_cache`](/docs/app/api-reference/functions/unstable_cache) | | | | | | [`unstable_cache`](/docs/app/api-reference/functions/unstable_cache) | | | Cache | |
### `<Link>` ### `<Link>`
......
...@@ -21,7 +21,9 @@ export default async function Component({ userID }) { ...@@ -21,7 +21,9 @@ export default async function Component({ userID }) {
``` ```
> **Good to know**: > **Good to know**:
> Accessing dynamic data sources such as `headers` or `cookies` inside a cache scope is not supported. If you need this data inside a cached function use `headers` outside of the cached function and pass the required dynamic data in as an argument. >
> - Accessing dynamic data sources such as `headers` or `cookies` inside a cache scope is not supported. If you need this data inside a cached function use `headers` outside of the cached function and pass the required dynamic data in as an argument.
> - This API uses Next.js' built-in [Data Cache](/docs/app/building-your-application/caching#data-cache) to persist the result across requests and deployments.
> **Warning**: This API is unstable and may change in the future. We will provide migration documentation and codemods, if needed, as this API stabilizes. > **Warning**: This API is unstable and may change in the future. We will provide migration documentation and codemods, if needed, as this API stabilizes.
......
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