mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
In Next 15, route handlers should no longer cache any `fetch` requests by default. We do this by bailing out of caching if no explicit cache config is defined. However, this misses the case where `cache: "default"` is specified. Since the default caching behavior is to not cache, this should also opt into the automatic no cache behavior. This adds a test for the route handler and still validates that it doesn't impact page-level ISR cache.
14 lines
280 B
JavaScript
14 lines
280 B
JavaScript
export default async function Page() {
|
|
const data = await fetch(
|
|
`https://next-data-api-endpoint.vercel.app/api/random`,
|
|
{ cache: 'default' }
|
|
).then((res) => res.text())
|
|
|
|
return (
|
|
<>
|
|
<p>/default-config-fetch</p>
|
|
<p id="data">{data}</p>
|
|
</>
|
|
)
|
|
}
|