interface CacheControl {
    maxAge?: number | boolean;
    mustRevalidate?: boolean;
    noCache?: boolean;
    noStore?: boolean;
    staleIfError?: number | boolean;
    staleWhileRevalidate?: number | boolean;
}

Properties

maxAge?: number | boolean

Maximum freshness time of cached items in seconds. Alternatively, true is interpreted as infinite, false as 0.

mustRevalidate?: boolean

The must-revalidate response directive indicates that the response can be stored in caches and can be reused while fresh. If the response becomes stale, it must be validated with the origin server before reuse (otherwise the client is allowed to reuse the cached value on connection errors). Typically, must-revalidate is used with max-age.

noCache?: boolean
noStore?: boolean
staleIfError?: number | boolean

The stale-if-error response directive indicates that the cache can reuse a stale response when an upstream server generates an error, or when the error is generated locally. Here, an error is considered any response with a status code of 500, 502, 503, or 504.

staleWhileRevalidate?: number | boolean

The stale-while-revalidate response directive indicates that the cache could reuse a stale response while it revalidates it to a cache.