7c408e7a0f
Fixes: #24806 Fixes: #26689 Fixes: #27325 Closes: #24807 @tommarshall has done us a huge favor with his PR https://github.com/vercel/next.js/pull/24807 which outlines exactly the issue and a pragmatic solution. I'm not trying to "steal their work", however, the PR seems to have been stuck for some months. I think there's huge value in this for myself and others as essentially **ISR is broken** for people running Next.js at scale 😱 This PR has cherry-picked @tommarshall's fine fix and added some integrations tests around page revalidation and the edge case when the cache size is exhausted. ✏️ Edits are enabled, so feel free great Vercel staff and other maintainers to improve my bad tests or surrounding code 🙇 ## Bug - [x] Related issues linked using `fixes #number` - [x] Integration tests added
22 lines
377 B
JavaScript
22 lines
377 B
JavaScript
export async function getStaticProps() {
|
|
return {
|
|
props: {
|
|
world: 'world',
|
|
time: new Date().getTime(),
|
|
other: Math.random(),
|
|
},
|
|
revalidate: 1,
|
|
}
|
|
}
|
|
|
|
const Page = ({ world, time, other }) => {
|
|
return (
|
|
<div>
|
|
<p>hello {world}</p>
|
|
<span>time: {time}</span>
|
|
<span>other: {other}</span>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export default Page
|