interface CachedResponsePayload
Since 0.1.0

Serializable cached response payload stored in the cache backend. Body is base64-encoded when binary so that JSON-safe stores (Redis) can persist it without corruption.

Properties

status: number

HTTP status code.

headers: Array<[string, string]>

Headers as [name, value] pairs.

body: string | null

Body content (decoded string or base64-encoded bytes).

optional
bodyEncoding: "base64"

Present when the body was base64-encoded during storage. The replay helper decodes it back to Uint8Array.

Usage

import { type CachedResponsePayload } from "cache-plugin/src/index.ts";