Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/fathym_common/src/common/http/processCacheControlHeaders.ts>processCacheControlHeaders

The Fathym Reference Architecture provides the common foundation for applications built in Typescript.
Latest
function processCacheControlHeaders
import { processCacheControlHeaders } from "https://deno.land/x/fathym_common@v0.2.160/src/common/http/processCacheControlHeaders.ts";

Processes cache control headers on a response.

Examples

From direct import

import { processCacheControlHeaders } from "@fathym/common/http";

const resp = processCacheControlHeaders(response, {
 'text\\/css': `public, max-age=${60 * 60 * 24 * 365}, immutable`

});

From common import

import { processCacheControlHeaders } from "@fathym/common";

const resp = processCacheControlHeaders(response, {
 'text\\/css': `public, max-age=${60 * 60 * 24 * 365}, immutable`

});

Parameters

resp: Response

The response to process.

optional
cacheControl: Record<string, string>

An optional object with cache control headers. The keys are regular expressions to match content types, and the value is used as the cache control header value.

optional
forceCache: boolean

Returns

The response with updated cache control headers.