Skip to content

Commit 67d86b0

Browse files
committed
fix: bypass next tag cache when there are no tags to check
1 parent 23ed1df commit 67d86b0

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

.changeset/rude-trains-know.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@opennextjs/aws": patch
3+
---
4+
5+
fix: bypass next tag cache when there are no tags to check

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ export async function hasBeenRevalidated(
2323
}
2424
const lastModified = cacheEntry.lastModified ?? Date.now();
2525
if (globalThis.tagCache.mode === "nextMode") {
26-
return await globalThis.tagCache.hasBeenRevalidated(tags, lastModified);
26+
return tags.length === 0
27+
? false
28+
: await globalThis.tagCache.hasBeenRevalidated(tags, lastModified);
2729
}
2830
// TODO: refactor this, we should introduce a new method in the tagCache interface so that both implementations use hasBeenRevalidated
2931
const _lastModified = await globalThis.tagCache.getLastModified(

0 commit comments

Comments
 (0)