forked from vercel/next.js
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure minimalMode previousCache expire time is capped (vercel#35954)
- Loading branch information
1 parent
95870fb
commit d16fdc6
Showing
3 changed files
with
62 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
test/production/required-server-files/pages/gsp-long-revalidate.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import fs from 'fs' | ||
import path from 'path' | ||
|
||
let gspCalls = 0 | ||
|
||
export async function getStaticProps() { | ||
const data = await fs.promises.readFile( | ||
path.join(process.cwd(), 'data.txt'), | ||
'utf8' | ||
) | ||
gspCalls += 1 | ||
|
||
if (data.trim() === 'hide') { | ||
return { | ||
notFound: true, | ||
revalidate: 1, | ||
} | ||
} | ||
|
||
return { | ||
props: { | ||
hello: 'world', | ||
data, | ||
gspCalls, | ||
}, | ||
revalidate: 100, | ||
} | ||
} | ||
|
||
export default function Page(props) { | ||
return ( | ||
<> | ||
<p id="gsp">getStaticProps page</p> | ||
<p id="props">{JSON.stringify(props)}</p> | ||
</> | ||
) | ||
} |