-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix issues with revalidateTag/revalidatePath (#470)
* fix clearing data cache with revalidatePath * fix revalidatePath for fetch with no tag * fix revalidateTag for next 15 * e2e test * fix incorrectly writing to tag cache on set * added comment * Create gold-paws-laugh.md
- Loading branch information
Showing
9 changed files
with
147 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"open-next": patch | ||
--- | ||
|
||
Fix issues with revalidateTag/revalidatePath |
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,9 @@ | ||
import { revalidatePath } from "next/cache"; | ||
|
||
export const dynamic = "force-dynamic"; | ||
|
||
export async function GET() { | ||
revalidatePath("/revalidate-path"); | ||
|
||
return new Response("ok"); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
export default async function Page() { | ||
const timeInParis = await fetch( | ||
"http://worldtimeapi.org/api/timezone/Europe/Paris", | ||
{ | ||
next: { | ||
tags: ["path"], | ||
}, | ||
}, | ||
); | ||
// This one doesn't have a tag | ||
const timeInLondon = await fetch( | ||
"http://worldtimeapi.org/api/timezone/Europe/London", | ||
); | ||
const timeInParisJson = await timeInParis.json(); | ||
const parisTime = timeInParisJson.datetime; | ||
const timeInLondonJson = await timeInLondon.json(); | ||
const londonTime = timeInLondonJson.datetime; | ||
return ( | ||
<div> | ||
<h1>Time in Paris</h1> | ||
<p>Paris: {parisTime}</p> | ||
<h1>Time in London</h1> | ||
<p>London: {londonTime}</p> | ||
</div> | ||
); | ||
} |
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
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