[]previous and next page

cacheTags

Tags the page that is being rendered, so a later revalidateTag with one of the tags discards it.

Tags the page that is being rendered, so a later revalidateTag with one of the tags discards it. Call it from a loader or a component during a render. Tags of a response are kept with it, up to 64 of them of at most 256 characters.

Import#

ts
import { cacheTags } from "@shadow-js/dusk/server";

Signature#

ts
function cacheTags(...tags: string[]): void

Parameters#

Name Description
tags The tags.

Returns#

Nothing.

Throws#

  • RangeError when a tag is empty or too long, or when the response would carry more than 64.

Examples#

ts
loader: ({ params }) => { cacheTags(`post:${params.id}`); return loadPost(params.id); }