中文
· Hahaxiong

Why You Should Never Cache HTML Pages in Cloudflare Workers KV

Many tutorials store rendered HTML strings in Workers KV, which quickly breaks on the $0 Free Tier:

  • Workers KV Free allows only 1,000 writes/day. A single search-bot crawl across localized routes will exhaust KV.put() quota within hours.
  • Better pattern: Prefer build-time SSG (Workers Static Assets, zero quota usage). When dynamic edge caching is truly needed, use caches.default (Cache API) with s-maxage + stale-while-revalidate headers—zero KV writes consumed.

Discussion & Comments

Powered by GitHub Discussions (Giscus) · Zero DB Overhead · Markdown Supported