method ICacheApi.put
ICacheApi.put(
request: Request | string,
response: Response
): Promise<void>

Stores a response.

Throws on the platform's own refusals — a non-GET request, status 206, Vary: *, or an uncleared Set-Cookie — which is why assessCacheability checks first rather than letting this reject.

Parameters

request: Request | string

The cache key

response: Response

The response to store

Return Type

Promise<void>

Usage

import { type ICacheApi } from "cloudflare-plugin/src/index.ts";