Skip to content

Commit

Permalink
Docs: Changing information about data fetching cache (vercel#72301)
Browse files Browse the repository at this point in the history
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: Delba de Oliveira <[email protected]>
Co-authored-by: Sam Ko <[email protected]>
  • Loading branch information
3 people authored Nov 19, 2024
1 parent 2a4bdbd commit 8856f49
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/01-app/02-building-your-application/04-caching/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -415,9 +415,9 @@ See the [`useRouter` hook](/docs/app/api-reference/functions/use-router) API ref

### `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
let data = await fetch('https://api.vercel.app/blog', { cache: 'no-store' })
Expand Down

0 comments on commit 8856f49

Please sign in to comment.