Skip to content

Commit 4800749

Browse files
author
Nicolas Dorseuil
committed
remove build id from cache keys in overrides
1 parent df5b19f commit 4800749

File tree

4 files changed

+5
-13
lines changed

4 files changed

+5
-13
lines changed

packages/open-next/src/overrides/incrementalCache/fs-dev.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ import path from "node:path";
44
import type { IncrementalCache } from "types/overrides.js";
55
import { getMonorepoRelativePath } from "utils/normalize-path";
66

7-
const buildId = process.env.NEXT_BUILD_ID;
8-
const basePath = path.join(getMonorepoRelativePath(), `cache/${buildId}`);
7+
const basePath = path.join(getMonorepoRelativePath(), "cache");
98

109
const getCacheKey = (key: string) => {
1110
return path.join(basePath, `${key}.cache`);

packages/open-next/src/overrides/incrementalCache/multi-tier-ddb-s3.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ const awsFetch = (body: RequestInit["body"], type: "get" | "set" = "get") => {
4141
};
4242

4343
const buildDynamoKey = (key: string) => {
44-
const { NEXT_BUILD_ID } = process.env;
45-
return `__meta_${NEXT_BUILD_ID}_${key}`;
44+
return `__meta_${key}`;
4645
};
4746

4847
/**

packages/open-next/src/overrides/incrementalCache/s3-lite.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,10 @@ const awsFetch = async (key: string, options: RequestInit) => {
3434
};
3535

3636
function buildS3Key(key: string, extension: Extension) {
37-
const { CACHE_BUCKET_KEY_PREFIX, NEXT_BUILD_ID } = process.env;
37+
const { CACHE_BUCKET_KEY_PREFIX } = process.env;
3838
return path.posix.join(
3939
CACHE_BUCKET_KEY_PREFIX ?? "",
4040
extension === "fetch" ? "__fetch" : "",
41-
NEXT_BUILD_ID ?? "",
4241
extension === "fetch" ? key : `${key}.${extension}`,
4342
);
4443
}

packages/open-next/src/overrides/incrementalCache/s3.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,8 @@ import type { IncrementalCache } from "types/overrides";
1313
import { awsLogger } from "../../adapters/logger";
1414
import { parseNumberFromEnv } from "../../adapters/util";
1515

16-
const {
17-
CACHE_BUCKET_REGION,
18-
CACHE_BUCKET_KEY_PREFIX,
19-
NEXT_BUILD_ID,
20-
CACHE_BUCKET_NAME,
21-
} = process.env;
16+
const { CACHE_BUCKET_REGION, CACHE_BUCKET_KEY_PREFIX, CACHE_BUCKET_NAME } =
17+
process.env;
2218

2319
function parseS3ClientConfigFromEnv(): S3ClientConfig {
2420
return {
@@ -34,7 +30,6 @@ function buildS3Key(key: string, extension: Extension) {
3430
return path.posix.join(
3531
CACHE_BUCKET_KEY_PREFIX ?? "",
3632
extension === "fetch" ? "__fetch" : "",
37-
NEXT_BUILD_ID ?? "",
3833
extension === "fetch" ? key : `${key}.${extension}`,
3934
);
4035
}

0 commit comments

Comments
 (0)