ResponseCacheControl

import { ResponseCacheControl } from "jsr:@ende/http/unstable-cache-control";

interface ยท experimental

interface ResponseCacheControl extends CacheControlBase

Cache-Control directives for responses (e.g. from a server).

See also

Properties

noCache

noCache?: true | string[]

When true, the response must not be used from cache without revalidation. When an array, only the listed response header fields require revalidation; the rest of the response may be used without it.

private

private?: true | string[]

When true, the response is intended for a single user (private cache only). When an array, only the listed header field names are private.

public

public?: true

The response may be stored by any cache.

sMaxage

sMaxage?: number

Shared (e.g. CDN) cache maximum age in seconds. Overrides max-age for shared caches.

mustRevalidate

mustRevalidate?: true

When stale, the cache must revalidate before using the response.

proxyRevalidate

proxyRevalidate?: true

Same as must-revalidate but applies only to shared caches.

mustUnderstand

mustUnderstand?: true

The cache must not use the response if it does not understand the directive.

immutable

immutable?: true

The response will not change while fresh; caches may reuse it without revalidation.

staleWhileRevalidate

staleWhileRevalidate?: number

Allow use of stale response while revalidating in the background (seconds).

Source