Skip to content

Commit ecc83aa

Browse files
committed
directory -> prefix
1 parent 46d8047 commit ecc83aa

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

packages/cloudflare/src/api/cloudflare-context.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ declare global {
88
NEXT_CACHE_D1_REVALIDATIONS_TABLE?: string;
99
NEXT_CACHE_REVALIDATION_WORKER?: Service;
1010
NEXT_CACHE_R2_BUCKET?: R2Bucket;
11-
NEXT_CACHE_R2_DIRECTORY?: string;
11+
NEXT_CACHE_R2_PREFIX?: string;
1212
ASSETS?: Fetcher;
1313
}
1414
}

packages/cloudflare/src/api/r2-incremental-cache.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const ONE_YEAR_IN_SECONDS = 31536000;
1515
* An instance of the Incremental Cache that uses an R2 bucket (`NEXT_CACHE_R2_BUCKET`) as it's
1616
* underlying data store.
1717
*
18-
* The directory that the cache entries are stored in can be confused with the `NEXT_CACHE_R2_DIRECTORY`
18+
* The directory that the cache entries are stored in can be confused with the `NEXT_CACHE_R2_PREFIX`
1919
* environment variable, and defaults to `incremental-cache`.
2020
*
2121
* The cache uses an instance of the Cache API (`incremental-cache`) to store a local version of the
@@ -126,7 +126,7 @@ class R2IncrementalCache implements IncrementalCache {
126126
}
127127

128128
protected getR2Key(key: string, isFetch?: boolean): string {
129-
const directory = getCloudflareContext().env.NEXT_CACHE_R2_DIRECTORY ?? "incremental-cache";
129+
const directory = getCloudflareContext().env.NEXT_CACHE_R2_PREFIX ?? "incremental-cache";
130130
return `${directory}/${this.getBaseCacheKey(key, isFetch)}`;
131131
}
132132

packages/cloudflare/src/cli/build/utils/populate-cache.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export async function populateCache(opts: BuildOptions, config: OpenNextConfig,
8484
assets.forEach(({ fsPath, destPath }) => {
8585
const fullDestPath = path.join(
8686
"NEXT_CACHE_R2_BUCKET",
87-
process.env.NEXT_CACHE_R2_DIRECTORY ?? "incremental-cache",
87+
process.env.NEXT_CACHE_R2_PREFIX ?? "incremental-cache",
8888
destPath
8989
);
9090

0 commit comments

Comments
 (0)