Skip to main content
Home

CDN agnostic client for creating cache headers and purging cache contents.

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
94%
Published
4 months ago (0.1.5)
property GetCacheHeadersParams.vary

Add the specified headers to the cache key for the resource. Applies the vary header. This can be used to vary the cache based on certain request headers.

Examples

Example 1

// To vary the cache based on the `Accept-Language` header:
vary: ['Accept-Language']
// To vary the cache based on multiple headers:
vary: ['Accept-Language', 'Accept-Encoding']

Type

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@purge/core

Import symbol

import { type GetCacheHeadersParams } from "@purge/core";
or

Import directly with a jsr specifier

import { type GetCacheHeadersParams } from "jsr:@purge/core";

Add Package

pnpm i jsr:@purge/core
or (using pnpm 10.8 or older)
pnpm dlx jsr add @purge/core

Import symbol

import { type GetCacheHeadersParams } from "@purge/core";

Add Package

yarn add jsr:@purge/core
or (using Yarn 4.8 or older)
yarn dlx jsr add @purge/core

Import symbol

import { type GetCacheHeadersParams } from "@purge/core";

Add Package

vlt install jsr:@purge/core

Import symbol

import { type GetCacheHeadersParams } from "@purge/core";

Add Package

npx jsr add @purge/core

Import symbol

import { type GetCacheHeadersParams } from "@purge/core";

Add Package

bunx jsr add @purge/core

Import symbol

import { type GetCacheHeadersParams } from "@purge/core";