Skip to content

Commit

Permalink
Correct some documentation in Data Fetching page (#70394)
Browse files Browse the repository at this point in the history
### What?

This PR corrects and improves the documentation on the Data Fetching
page, ensuring that the information is accurate and clear.

### Why?

The previous version of the documentation contained inaccuracies or
unclear explanations that could lead to confusion for developers. By
addressing these issues, the documentation becomes more reliable and
user-friendly.

### How?

The changes involve updating the text to correct any misleading
statements, adding clarity where necessary, and ensuring that all
examples and explanations accurately reflect the intended data fetching
process.

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
  • Loading branch information
xugetsu and ijjk committed Sep 24, 2024
1 parent 8271e0a commit bd68cef
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ let data = await fetch('https://api.vercel.app/blog', { cache: 'no-store' })

### Fetching data on the server with an ORM or database

This component will fetch and display a list of blog posts. The response from the database will be cached.
This component will fetch and display a list of blog posts. The response from the database is not cached by default but could be with [additional configuration](#caching-data-with-an-orm-or-database).

```tsx filename="app/page.tsx" switcher
import { db, posts } from '@/lib/db'
Expand Down Expand Up @@ -131,7 +131,7 @@ export default async function Page() {

If you are not using any [dynamic functions](/docs/app/building-your-application/rendering/server-components#dynamic-rendering) anywhere else in this route, it will be prerendered during `next build` to a static page. The data can then be updated using [Incremental Static Regeneration](/docs/app/building-your-application/data-fetching/incremental-static-regeneration).

If you do _not_ want to cache the response from the database, you can add the following to your file:
To prevent the page from prerendering, you can add the following to your file:

```js
export const dynamic = 'force-dynamic'
Expand Down

0 comments on commit bd68cef

Please sign in to comment.