From 0faaf7aeabe59f5f254dc003a8d017c61d374ec1 Mon Sep 17 00:00:00 2001 From: Lee Robinson Date: Tue, 6 Aug 2024 12:06:24 -0500 Subject: [PATCH] docs: clarify caching of fetch based on comment (#68419) This code snippet comment was misleading, needs to be updated for Next.js 15 behavior. Co-authored-by: Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com> --- .../02-data-fetching/02-caching-and-revalidating.mdx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/02-app/01-building-your-application/02-data-fetching/02-caching-and-revalidating.mdx b/docs/02-app/01-building-your-application/02-data-fetching/02-caching-and-revalidating.mdx index 2450679ca12b5..955ca4a5cec11 100644 --- a/docs/02-app/01-building-your-application/02-data-fetching/02-caching-and-revalidating.mdx +++ b/docs/02-app/01-building-your-application/02-data-fetching/02-caching-and-revalidating.mdx @@ -10,12 +10,11 @@ Caching is the process of storing data to reduce the number of requests made to ### `fetch` requests -Starting with Next.js 15, `fetch` requests are not cached by default. +`fetch` requests are not cached by default in Next.js 15. To cache an individual `fetch` request, you can use the `cache: 'force-cache'` option: ```js -// 'force-cache' is the default, and can be omitted fetch('https://...', { cache: 'force-cache' }) ```