|
1
|
import { defineCloudflareConfig } from "@opennextjs/cloudflare" |
|
2
|
import r2IncrementalCache from "@opennextjs/cloudflare/overrides/incremental-cache/r2-incremental-cache" |
|
3
|
import { withRegionalCache } from "@opennextjs/cloudflare/overrides/incremental-cache/regional-cache" |
|
4
|
|
|
5
|
export default defineCloudflareConfig({ |
|
6
|
// Persist ISR / unstable_cache entries in R2 (they are no-ops without a |
|
7
|
// backing store), with a per-datacenter Cache API layer on top so repeat |
|
8
|
// requests in a region don't hit R2 at all. |
|
9
|
incrementalCache: withRegionalCache(r2IncrementalCache, { |
|
10
|
mode: "long-lived", |
|
11
|
}), |
|
12
|
}) |