-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathopen-next.config.ts
More file actions
32 lines (27 loc) · 1.11 KB
/
open-next.config.ts
File metadata and controls
32 lines (27 loc) · 1.11 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
28
29
30
31
32
import { defineCloudflareConfig } from "@opennextjs/cloudflare";
import { purgeCache } from "@opennextjs/cloudflare/overrides/cache-purge/index";
import kvIncrementalCache from "@opennextjs/cloudflare/overrides/incremental-cache/kv-incremental-cache";
import doQueue from "@opennextjs/cloudflare/overrides/queue/do-queue";
import queueCache from "@opennextjs/cloudflare/overrides/queue/queue-cache";
import doShardedTagCache from "@opennextjs/cloudflare/overrides/tag-cache/do-sharded-tag-cache";
export default defineCloudflareConfig({
// KV Incremental Cache
incrementalCache: kvIncrementalCache,
// Keep queue with cache for efficient revalidation
queue: queueCache(doQueue, {
regionalCacheTtlSec: 10,
}),
tagCache: doShardedTagCache({
baseShardSize: 12,
regionalCache: true,
regionalCacheTtlSec: 10,
shardReplication: {
numberOfSoftReplicas: 4,
numberOfHardReplicas: 2,
},
}),
// Disable the cache interception for Partial Prerendering
enableCacheInterception: false,
// Add cache purge for automatic clearing on revalidation
cachePurge: purgeCache({ type: "direct" }),
});