Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure config and fetch revalidate are honored (#47255)
This ensures revalidate can be fetch specific instead of cache key specific and adds a test case to ensure config based revalidate isn't overridden by fetch based revalidate.
- Loading branch information
Showing
5 changed files
with
101 additions
and
24 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
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
24 changes: 24 additions & 0 deletions
24
test/e2e/app-dir/app-static/app/variable-config-revalidate/revalidate-3/page.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,24 @@ | ||
export const revalidate = 3 | ||
|
||
export const metadata = { | ||
title: 'Cache Test', | ||
} | ||
|
||
export default async function Page() { | ||
const data = await fetch( | ||
'https://next-data-api-endpoint.vercel.app/api/random', | ||
{ | ||
next: { | ||
revalidate: 15, | ||
}, | ||
} | ||
).then((res) => res.text()) | ||
|
||
return ( | ||
<> | ||
<p>/variable-config-revalidate/revalidate-3</p> | ||
<p id="date">{Date.now()}</p> | ||
<p id="data">{data}</p> | ||
</> | ||
) | ||
} |