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
33import shardedTagCache from "@opennextjs/cloudflare/overrides/tag-cache/do-sharded-tag-cache" ;
44import doQueue from "@opennextjs/cloudflare/overrides/queue/do-queue" ;
55import queueCache from "@opennextjs/cloudflare/overrides/queue/queue-cache" ;
6- import { purgeCache } from "@opennextjs/cloudflare/overrides/cache-purge/index" ;
76
87export default defineCloudflareConfig ( {
98 incrementalCache : r2IncrementalCache ,
Original file line number Diff line number Diff line change @@ -31,3 +31,5 @@ export const purgeCache = ({ type = "direct" }: PurgeOptions) => {
3131 } ,
3232 } satisfies CDNInvalidationHandler ;
3333} ;
34+
35+ export default purgeCache ;
Original file line number Diff line number Diff line change @@ -81,8 +81,13 @@ class RegionalCache implements IncrementalCache {
8181 }
8282
8383 // 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" ;
8691 }
8792
8893 async get < CacheType extends CacheEntryType = "cache" > (
You can’t perform that action at this time.
0 commit comments