-
Notifications
You must be signed in to change notification settings - Fork 27k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(fetch-cache): add check for updated tags when checking same cache…
… key (#63547) ## Why? When we fetch the same cache key (URL) but add an additional tag, the revalidation does not re-fetch correctly (the bug just uses in-memory cache again) when deployed. :repro: → https://github.com/lostip/nextjs-revalidation-demo/tree/main --------- Co-authored-by: Ethan Arrowood <ethan@arrowood.dev>
- Loading branch information
1 parent
8c9c1d2
commit 39a1c2a
Showing
4 changed files
with
105 additions
and
2 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
13 changes: 13 additions & 0 deletions
13
test/e2e/app-dir/app-static/app/specify-new-tags/one-tag/page.tsx
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,13 @@ | ||
export const dynamic = 'force-dynamic' | ||
|
||
export default async function Page() { | ||
const data = await fetch( | ||
'https://next-data-api-endpoint.vercel.app/api/random?sam=iam', | ||
{ | ||
cache: 'force-cache', | ||
next: { tags: ['thankyounext'] }, | ||
} | ||
).then((res) => res.text()) | ||
|
||
return <p id="page-data">data: {data}</p> | ||
} |
13 changes: 13 additions & 0 deletions
13
test/e2e/app-dir/app-static/app/specify-new-tags/two-tags/page.tsx
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,13 @@ | ||
export const dynamic = 'force-dynamic' | ||
|
||
export default async function Page() { | ||
const data = await fetch( | ||
'https://next-data-api-endpoint.vercel.app/api/random?sam=iam', | ||
{ | ||
cache: 'force-cache', | ||
next: { tags: ['thankyounext', 'justputit'] }, | ||
} | ||
).then((res) => res.text()) | ||
|
||
return <p id="page-data">data: {data}</p> | ||
} |