-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: make
revalidateTags
no-op when list of tags is empty (#2727)
* fix: make `revalidateTags` no-op when list of tags is empty * fix: oops * test: add integration test for site-wide purge calls * fix: filter out empty tags * test: correct afterEach import --------- Co-authored-by: pieh <[email protected]>
- Loading branch information
1 parent
871f7b9
commit 38e58b3
Showing
3 changed files
with
115 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { unstable_cache } from 'next/cache' | ||
|
||
export const dynamic = 'force-dynamic' | ||
|
||
const getData = unstable_cache( | ||
async () => { | ||
return { | ||
timestamp: Date.now(), | ||
} | ||
}, | ||
[], | ||
{ | ||
revalidate: 1, | ||
}, | ||
) | ||
|
||
export default async function Page() { | ||
const data = await getData() | ||
|
||
return <pre>{JSON.stringify(data, null, 2)}</pre> | ||
} |
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