Files
Zack TannerandGitHub 19f93c895c fetch cache: revalidate should take precedence over force-dynamic (#72357)
`force-dynamic` will automatically disable caching on a fetch. If `force-dynamic` is set, and there's a `revalidate` value on the fetch, the revalidate value will be a no-op unless you explicitly opt into caching via `cache: 'force-cache'`. This changes the behavior to favor a positive revalidate value over `force-dynamic` when deciding to cache the fetch.
2024-11-06 07:24:00 -08:00

15 lines
311 B
JavaScript

export const dynamic = 'force-dynamic'
export default async function Page() {
const data = await fetch(
'https://next-data-api-endpoint.vercel.app/api/random?revalidate-3',
{
next: {
revalidate: 3,
},
}
).then((res) => res.text())
return <div>Hello World! {data}</div>
}