File tree Expand file tree Collapse file tree
packages/cloudflare/src/api Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,12 +17,6 @@ import { getCloudflareContext } from "./cloudflare-context.js";
1717class R2IncrementalCache implements IncrementalCache {
1818 readonly name = "r2-incremental-cache" ;
1919
20- protected directory : string ;
21-
22- constructor ( ) {
23- this . directory = getCloudflareContext ( ) . env . NEXT_CACHE_R2_PREFIX ?? "incremental-cache" ;
24- }
25-
2620 async get < IsFetch extends boolean = false > (
2721 key : string ,
2822 isFetch ?: IsFetch
@@ -77,7 +71,9 @@ class R2IncrementalCache implements IncrementalCache {
7771 }
7872
7973 protected getR2Key ( key : string , isFetch ?: boolean ) : string {
80- return `${ this . directory } /${ process . env . NEXT_BUILD_ID ?? "no-build-id" } /${ key } .${ isFetch ? "fetch" : "cache" } ` ;
74+ const directory = getCloudflareContext ( ) . env . NEXT_CACHE_R2_PREFIX ?? "incremental-cache" ;
75+
76+ return `${ directory } /${ process . env . NEXT_BUILD_ID ?? "no-build-id" } /${ key } .${ isFetch ? "fetch" : "cache" } ` ;
8177 }
8278}
8379
You can’t perform that action at this time.
0 commit comments