-
Notifications
You must be signed in to change notification settings - Fork 119
Expand file tree
/
Copy pathopen-next.config.ts
More file actions
27 lines (26 loc) · 1.13 KB
/
open-next.config.ts
File metadata and controls
27 lines (26 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { defineCloudflareConfig } from "@opennextjs/cloudflare";
import r2IncrementalCache from "@opennextjs/cloudflare/overrides/incremental-cache/r2-incremental-cache";
import shardedTagCache from "@opennextjs/cloudflare/overrides/tag-cache/do-sharded-tag-cache";
import doQueue from "@opennextjs/cloudflare/overrides/queue/do-queue";
import queueCache from "@opennextjs/cloudflare/overrides/queue/queue-cache";
import { purgeCache } from "@opennextjs/cloudflare/overrides/cache-purge/index";
export default defineCloudflareConfig({
incrementalCache: r2IncrementalCache,
// With such a configuration, we could have up to 12 * (8 + 2) = 120 Durable Objects instances
tagCache: shardedTagCache({
baseShardSize: 12,
regionalCache: true,
regionalCacheDangerouslyPersistMissingTags: true,
shardReplication: {
numberOfSoftReplicas: 8,
numberOfHardReplicas: 2,
regionalReplication: {
defaultRegion: "enam",
},
},
}),
// `CACHE_PURGE_ZONE_ID` and `CACHE_PURGE_API_TOKEN` are required to enable cache purge
// cachePurge: purgeCache({ type: "durableObject" }),
enableCacheInterception: true,
queue: queueCache(doQueue),
});