Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct some documentation in Data Fetching page #70394

Merged
merged 3 commits into from
Sep 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading