rsnext/test/integration/prerender-revalidate/pages/index.js
Jamie 7c408e7a0f
Fix ISR page re-rendering after revalidate expiry (Fork of #24807) (#27335)
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
2021-07-20 17:01:42 +00:00

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