Files
2ebc58cca3 add tests for incremental-cache (#60331)
### 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]>
2024-01-09 11:07:08 -08:00

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(''),
})
}