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]>
12 lines
247 B
JavaScript
12 lines
247 B
JavaScript
import { NextResponse } from 'next/server'
|
|
|
|
export async function GET() {
|
|
console.log('Load data')
|
|
return NextResponse.json({
|
|
now: Date.now(),
|
|
content: Array.from(new Array(3 * 1024 * 1024))
|
|
.map(() => 1)
|
|
.join(''),
|
|
})
|
|
}
|