RouteCacheOptions
The cache option of a page route.
The cache option of a page route. See RouteOptions.cache.
Import#
ts
import type { RouteCacheOptions } from "@shadow-js/router";
Signature#
ts
interface RouteCacheOptions {
/** Seconds a stale response may still be served while it regenerates. Default: the `revalidate` value. */
readonly staleSeconds?: number;
/** Cookies the response depends on. A request carrying other cookies is never served from the cache. */
readonly cookies?: readonly string[];
/** Query parameters that are part of the cache key. Default: all of them. */
readonly searchParams?: readonly string[];
}
Members#
| Name | Type | Description |
|---|---|---|
staleSeconds? |
readonly staleSeconds?: number |
Seconds a stale response may still be served while it regenerates. Default: the revalidate value. |
cookies? |
readonly cookies?: readonly string[] |
Cookies the response depends on. A request carrying other cookies is never served from the cache. |
searchParams? |
readonly searchParams?: readonly string[] |
Query parameters that are part of the cache key. Default: all of them. |