File tree Expand file tree Collapse file tree 4 files changed +14
-3
lines changed
packages/cloudflare/src/api/overrides Expand file tree Collapse file tree 4 files changed +14
-3
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " @opennextjs/cloudflare " : patch
3
+ ---
4
+
5
+ fix: detection of cache purge
Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ import r2IncrementalCache from "@opennextjs/cloudflare/overrides/incremental-cac
3
3
import shardedTagCache from "@opennextjs/cloudflare/overrides/tag-cache/do-sharded-tag-cache" ;
4
4
import doQueue from "@opennextjs/cloudflare/overrides/queue/do-queue" ;
5
5
import queueCache from "@opennextjs/cloudflare/overrides/queue/queue-cache" ;
6
- import { purgeCache } from "@opennextjs/cloudflare/overrides/cache-purge/index" ;
7
6
8
7
export default defineCloudflareConfig ( {
9
8
incrementalCache : r2IncrementalCache ,
Original file line number Diff line number Diff line change @@ -31,3 +31,5 @@ export const purgeCache = ({ type = "direct" }: PurgeOptions) => {
31
31
} ,
32
32
} satisfies CDNInvalidationHandler ;
33
33
} ;
34
+
35
+ export default purgeCache ;
Original file line number Diff line number Diff line change @@ -81,8 +81,13 @@ class RegionalCache implements IncrementalCache {
81
81
}
82
82
83
83
// Otherwise we default to whether the automatic cache purging is enabled or not
84
- const hasAutomaticCachePurging = ! ! getCloudflareContext ( ) . env . NEXT_CACHE_DO_PURGE ;
85
- return hasAutomaticCachePurging ;
84
+ return this . #hasAutomaticCachePurging;
85
+ }
86
+
87
+ get #hasAutomaticCachePurging( ) {
88
+ const cdnInvalidation = globalThis . openNextConfig . default ?. override ?. cdnInvalidation ;
89
+
90
+ return cdnInvalidation !== undefined && cdnInvalidation !== "dummy" ;
86
91
}
87
92
88
93
async get < CacheType extends CacheEntryType = "cache" > (
You can’t perform that action at this time.
0 commit comments