Skip to content

Commit 95ee107

Browse files
kaungMinnicyJoseph
andauthored
Update caching.mdx (#83149)
In the docs it says => ( 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 ) But when I code, I found that fetch default behaviour and setting the cache option to no-store are different. After building process .... When changing routes. default is stored as cache. I see that because there is no new network request when I change route. In setting the cache option to no-store, it is making a new network request as soon as i get back to the page. so docs and real working one are mismatch. I also provided how tested with pictures belows. Please build... and check Change routes... <img width="545" height="371" alt="image" src="https://github.com/user-attachments/assets/4931302f-b5ef-4016-b43d-cbbd790c1e11" /> <img width="601" height="409" alt="image" src="https://github.com/user-attachments/assets/3f2b4a79-fa24-466f-8330-0dc8323b6c16" /> Fixes #83146 --------- Co-authored-by: Joseph <joseph.chamochumbi@vercel.com>
1 parent 828221d commit 95ee107

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

docs/01-app/02-guides/caching.mdx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -421,11 +421,10 @@ See the [`useRouter` hook](/docs/app/api-reference/functions/use-router) API ref
421421

422422
Data returned from `fetch` is _not_ automatically cached in the Data Cache.
423423

424-
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`:
424+
By default, when no `cache` or `next.revalidate` options are provided:
425425

426-
```js
427-
let data = await fetch('https://api.vercel.app/blog', { cache: 'no-store' })
428-
```
426+
- [Dynamic rendering](/docs/app/getting-started/partial-prerendering#dynamic-rendering): Fetch runs on every request and always returns fresh data.
427+
- [Static rendering](/docs/app/getting-started/partial-prerendering#static-rendering): Fetched data is stored in the [Data Cache](#data-cache), and the rendered output in the [Full Route Cache](#full-route-cache). Next.js serves this cached result until the path is revalidated.
429428

430429
See the [`fetch` API Reference](/docs/app/api-reference/functions/fetch) for more options.
431430

0 commit comments

Comments
 (0)