Skip to content

Commit 9f546f3

Browse files
authored
Use R2 incremental cache for the template (#562)
1 parent b002d80 commit 9f546f3

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// default open-next.config.ts file created by @opennextjs/cloudflare
22
import { defineCloudflareConfig } from "@opennextjs/cloudflare/config";
3-
import kvIncrementalCache from "@opennextjs/cloudflare/overrides/incremental-cache/kv-incremental-cache";
3+
import r2IncrementalCache from "@opennextjs/cloudflare/overrides/incremental-cache/r2-incremental-cache";
44

55
export default defineCloudflareConfig({
6-
incrementalCache: kvIncrementalCache,
6+
incrementalCache: r2IncrementalCache,
77
});

packages/cloudflare/templates/wrangler.jsonc

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,11 @@
88
"directory": ".open-next/assets",
99
"binding": "ASSETS"
1010
},
11-
"kv_namespaces": [
12-
// Create a KV binding with the binding name "NEXT_INC_CACHE_KV"
13-
// to enable the KV based caching:
11+
"r2_buckets": [
12+
// Create a binding to use R2 incremental cache
1413
// {
15-
// "binding": "NEXT_INC_CACHE_KV",
16-
// "id": "<BINDING_ID>"
17-
// }
14+
// "binding": "NEXT_INC_CACHE_R2_BUCKET",
15+
// "bucket_name": "<BUCKET_NAME>",
16+
// },
1817
]
1918
}

0 commit comments

Comments
 (0)