Files
cloudflare__vinext/packages/cloudflare
github-actions[bot] 91c169a8fc chore: version packages (#1875)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-06-12 10:30:11 +00:00
..
2026-06-12 10:30:11 +00:00
2026-06-12 10:30:11 +00:00

@vinext/cloudflare

Cloudflare cache adapters for vinext.

This package provides the Cloudflare-specific cache backends that vinext uses for ISR and the "use cache" data cache when deploying to Cloudflare Workers:

  • kvDataAdapter() (@vinext/cloudflare/cache/kv-data-adapter) — backs the data cache (fetch, "use cache", unstable_cache) with a Workers KV namespace. Also used for ISR in the absence of a cdn adapter.

Usage

Declare the adapters on the vinext() plugin in your Vite config:

import { kvDataAdapter } from "@vinext/cloudflare/cache/kv-data-adapter";

export default defineConfig({
  plugins: [
    vinext({
      cache: {
        data: kvDataAdapter(), // KV-backed data cache (binding: VINEXT_KV_CACHE)
      },
    }),
    cloudflare(),
  ],
});