@@ -271,7 +271,7 @@ If you are using `fetch`, requests can be [memoized](/docs/app/building-your-app
>
> - In previous versions of Next.js, using `fetch` would have a default `cache` value of `force-cache`. This changed in version 15, to a default of `cache: no-store`.
```tsx filename="app/page.tsx" switcher
```tsx filename="app/blog/[id]/page.tsx" switcher
import { notFound } from 'next/navigation'
interface Post {
...
...
@@ -281,21 +281,21 @@ interface Post {
}
async function getPost(id: string) {
let res = await fetch(`https://api.vercel.app/blog/${id}`, {
const res = await fetch(`https://api.vercel.app/blog/${id}`, {
cache: 'force-cache',
})
let post: Post = await res.json()
const post: Post = await res.json()
if (!post) notFound()
return post
}
export async function generateStaticParams() {
let posts = await fetch('https://api.vercel.app/blog', {