[]previous and next page

CacheDataOptions

Options of cacheData.

Options of cacheData.

Import#

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

Signature#

ts
interface CacheDataOptions {
  /** The key: an array of plain data (the query key format). */
  readonly key: QueryKey;
  /** Tags of the entry, for `revalidateTag`. Up to 16, each 1 to 256 characters. */
  readonly tags?: readonly string[];
  /** Seconds the value is fresh, or `false` for never. The stale window is as long again. */
  readonly revalidate?: number | false;
  /** The name of a profile: `"seconds"`, `"minutes"`, `"hours"`, `"days"`, `"weeks"`, `"max"` or one from `cacheLife`. */
  readonly cacheLife?: string;
  /** Runs the function and stores nothing (draft mode sets this for every call). */
  readonly bypass?: boolean;
  /**
   * The caller's own signal. When it aborts the call rejects with its reason at once; a run that other callers share
   * keeps going, and the function's own signal (its parameter) aborts only when every caller left.
   */
  readonly signal?: AbortSignal;
}

Members#

Name Type Description
key readonly key: QueryKey The key: an array of plain data (the query key format).
tags? readonly tags?: readonly string[] Tags of the entry, for revalidateTag. Up to 16, each 1 to 256 characters.
revalidate? readonly revalidate?: number | false Seconds the value is fresh, or false for never. The stale window is as long again.
cacheLife? readonly cacheLife?: string The name of a profile: "seconds", "minutes", "hours", "days", "weeks", "max" or one from cacheLife.
bypass? readonly bypass?: boolean Runs the function and stores nothing (draft mode sets this for every call).
signal? readonly signal?: AbortSignal The caller's own signal. When it aborts the call rejects with its reason at once; a run that other callers share keeps going, and the function's own signal (its parameter) aborts only when every caller left.