mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
### What? In the previous PR (#60249), it was found that the case when the response size is larger than 2MB is not sufficiently covered by tests [[comment](https://github.com/vercel/next.js/pull/60249#pullrequestreview-1807140518)] ### How? I added a few more checks. Just checking the number of API calls is not enough - I believe it is important to additionally verify what exactly the page received. If I'm honest, I couldn't find the exact reason why data is loaded after application start when using `customCacheHandler`, but without it - during build. It seems like something in the butcher. Therefore, in this part, I simply configured it for the current version. --------- Co-authored-by: JJ Kasper <[email protected]>
19 lines
350 B
JavaScript
19 lines
350 B
JavaScript
export default async function Page() {
|
|
const resp = await fetch(
|
|
`http://localhost:${process.env.PORT}/api/large-data`,
|
|
{
|
|
cache: 'force-cache',
|
|
}
|
|
)
|
|
const data = await resp.json()
|
|
|
|
return (
|
|
<>
|
|
<p id="content">{data.content}</p>
|
|
<p id="now">{data.now}</p>
|
|
</>
|
|
)
|
|
}
|
|
|
|
export const dynamic = 'force-dynamic'
|