SYSTEM Cited by 1 source
vinext KVCacheHandler¶
KVCacheHandler is the default Cloudflare-KV-backed cache
handler shipped with vinext (from
vinext/cloudflare). Plugs into Next.js's
setCacheHandler() API so
ISR works out of
the box on Workers.
import { KVCacheHandler } from "vinext/cloudflare";
import { setCacheHandler } from "next/cache";
setCacheHandler(new KVCacheHandler(env.MY_KV_NAMESPACE));
Pluggable by design¶
"The caching layer is designed to be pluggable. That
setCacheHandler call means you can swap in whatever backend
makes sense." Named alternatives:
- R2 — better fit for apps with large cached payloads or different access patterns.
- Cloudflare Cache API — post-launch target. "We're also working on improvements to our Cache API that should provide a strong caching layer with less configuration."
Canonical wiki instance of patterns/pluggable-cache-handler.
Seen in¶
Related¶
- systems/vinext — host framework.
- systems/cloudflare-kv — default substrate.
- systems/cloudflare-r2 — alternative substrate.
- concepts/incremental-static-regeneration — the caching semantics this handler implements.
- patterns/pluggable-cache-handler — the structural pattern.