Skip to content

Commit 55123b9

Browse files
committed
fix & comment
1 parent 723372e commit 55123b9

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

packages/open-next/src/adapters/cache.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,7 @@ export default class Cache {
435435
await globalThis.tagCache.writeTags(toInsert);
436436

437437
// We can now invalidate all paths in the CDN
438+
// This only applies to `revalidateTag`, not to `res.revalidate()`
438439
const uniquePaths = Array.from(
439440
new Set(
440441
toInsert

packages/open-next/src/core/routing/util.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,7 @@ export function createServerResponse(
431431
);
432432
}
433433

434+
// This function is used only for `res.revalidate()`
434435
export async function invalidateCDNOnRequest(params: {
435436
//TODO: use the initialPath instead of rawPath, a rewrite could have happened and would make cdn invalidation fail
436437
rawPath: string;

packages/open-next/src/overrides/cdnInvalidation/cloudfront.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export default {
1414
? [`${path}`, `${path}?_rsc=*`]
1515
: [
1616
`${path}`,
17-
`_next/data/${process.env.NEXT_BUILD_ID}${path === "/" ? "/index" : path}.json*`,
17+
`/_next/data/${process.env.NEXT_BUILD_ID}${path === "/" ? "/index" : path}.json*`,
1818
],
1919
);
2020
await cloudfront.send(

0 commit comments

Comments
 (0)