latest
claytercek/purgeCDN agnostic client for creating cache headers and purging cache contents.
This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers




JSR Score
94%
Published
2 weeks ago (0.1.5)
This module provides a CDN agnostic client for purging cache tags and generating CDN specific cache control headers.
Example 1
Example 1
import { createPurge } from "@purge/core"; import { MyCDNProvider } from "@purge/my-cdn"; const purgeClient = createPurge({ provider: new MyCDNProvider() }); // Purge cache tags await purgeClient.purgeCache({ tags: ["tag1", "tag2"] }); // Get cache headers for tags const headers = purgeClient.getCacheHeaders({ tags: ["tag1", "tag2"] });
Add Package
deno add jsr:@purge/core
Import symbol
import * as core from "@purge/core";
Import directly with a jsr specifier
import * as core from "jsr:@purge/core";
Add Package
pnpm i jsr:@purge/core
pnpm dlx jsr add @purge/core
Import symbol
import * as core from "@purge/core";
Add Package
yarn add jsr:@purge/core
yarn dlx jsr add @purge/core
Import symbol
import * as core from "@purge/core";
Add Package
vlt install jsr:@purge/core
Import symbol
import * as core from "@purge/core";
Add Package
npx jsr add @purge/core
Import symbol
import * as core from "@purge/core";
Add Package
bunx jsr add @purge/core
Import symbol
import * as core from "@purge/core";