Cloudflare Worker Cache Tags
Workers HTTP Cache used the way it is meant to be used: cache: { enabled: true } puts a cache in front of the fetch handler so a hit never invokes the Worker, and the Worker's only job becomes emitting Cache-Control plus Cache-Tag and purging tags on write. Includes a derived tag vocabulary, tagged negative caching for 404s, stale-while-revalidate, ctx.cache.purge({ tags }) from a WorkerEntrypoint, the module-level cache import from cloudflare:workers for a queue consumer that has no ctx, pathPrefixes purge, and a per-export cache override so the admin entrypoint stays uncached.
npx shadcn@latest add https://ui.aryank.space/r/cloudflare-worker-cache-tags.jsonInstalls from ui.aryank.space. To add it by hand, copy the files in Files below, or register the @compronents namespace via the docs.
One product's price changes and the only lever is purge-all, so the entire cache empties. Every request that was a 2ms hit is suddenly a miss, and the origin absorbs the whole site's traffic at once because one row changed.
@cloudflare/[email protected]