Unverified Commit 8856f49f authored by Florian Boeck's avatar Florian Boeck Committed by GitHub

Docs: Changing information about data fetching cache (#72301)

What is the documentation issue?
There is incorrect information about how fetch works in the new Next.js
version (^15.0.0).
The documentation says that fetch is automatically cached in the said
version but now by default fetchs are no longer being cached

Is there any context that might help us understand?
[Link of the
section](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionscache)

Does the docs page already exist? Please link to it.

https://nextjs.org/docs/app/building-your-application/caching#fetch-optionscache

---------
Co-authored-by: 's avatarDelba de Oliveira <32464864+delbaoliveira@users.noreply.github.com>
Co-authored-by: 's avatarSam Ko <sam@vercel.com>
parent 2a4bdbd4
...@@ -415,9 +415,9 @@ See the [`useRouter` hook](/docs/app/api-reference/functions/use-router) API ref ...@@ -415,9 +415,9 @@ See the [`useRouter` hook](/docs/app/api-reference/functions/use-router) API ref
### `fetch` ### `fetch`
Data returned from `fetch` is automatically cached in the Data Cache. Data returned from `fetch` is _not_ automatically cached in the Data Cache.
If you do _not_ want to cache the response from `fetch`, you can do the following: The default caching behavior of `fetch` (e.g., when the `cache` option is not specified) is equal to setting the `cache` option to `no-store`:
```js ```js
let data = await fetch('https://api.vercel.app/blog', { cache: 'no-store' }) let data = await fetch('https://api.vercel.app/blog', { cache: 'no-store' })
......
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