revalidateTag
Discards every cached page indexed under a tag.
Discards every cached page indexed under a tag. Tags come from cacheTags (called while a page
renders) and from the path of each page, which revalidatePath also uses.
Import#
ts
import { revalidateTag } from "@shadow-js/dusk/server";
Signature#
ts
async function revalidateTag(tag: string): Promise<void>
Parameters#
| Name | Description |
|---|---|
tag |
The tag. |
Returns#
A promise that resolves when the entries are removed.
Throws#
- TypeError for an empty tag; DuskError outside a request.
Examples#
ts
await revalidateTag("posts");