From bcdbb76f28ce4612f327aabfedbd62cf73880fb2 Mon Sep 17 00:00:00 2001 From: Ali Othmani Date: Tue, 24 Sep 2024 11:00:11 +0100 Subject: [PATCH 1/2] Correct some documentation in Data Fetching page --- .../02-data-fetching/01-fetching.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/02-app/01-building-your-application/02-data-fetching/01-fetching.mdx b/docs/02-app/01-building-your-application/02-data-fetching/01-fetching.mdx index cd2e5c1fac785..79cece4ce042a 100644 --- a/docs/02-app/01-building-your-application/02-data-fetching/01-fetching.mdx +++ b/docs/02-app/01-building-your-application/02-data-fetching/01-fetching.mdx @@ -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 will not be cached. ```tsx filename="app/page.tsx" switcher import { db, posts } from '@/lib/db' @@ -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: +If you want to _avoid_ caching the database response in the statically rendered page, you can add the following to your file: ```js export const dynamic = 'force-dynamic' From 11c822d6ece9415edf660c9ed098dd8d95cf3968 Mon Sep 17 00:00:00 2001 From: Ali Othmani Date: Tue, 24 Sep 2024 20:29:55 +0100 Subject: [PATCH 2/2] Rephrase changes --- .../02-data-fetching/01-fetching.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/02-app/01-building-your-application/02-data-fetching/01-fetching.mdx b/docs/02-app/01-building-your-application/02-data-fetching/01-fetching.mdx index 79cece4ce042a..d4344d961a7a3 100644 --- a/docs/02-app/01-building-your-application/02-data-fetching/01-fetching.mdx +++ b/docs/02-app/01-building-your-application/02-data-fetching/01-fetching.mdx @@ -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 not 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' @@ -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 want to _avoid_ caching the database response in the statically rendered page, 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'