Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/rude-trains-know.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@opennextjs/aws": patch
---

fix: bypass next tag cache when there are no tags to check
4 changes: 3 additions & 1 deletion packages/open-next/src/utils/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ export async function hasBeenRevalidated(
}
const lastModified = cacheEntry.lastModified ?? Date.now();
if (globalThis.tagCache.mode === "nextMode") {
return await globalThis.tagCache.hasBeenRevalidated(tags, lastModified);
return tags.length === 0
? false
: await globalThis.tagCache.hasBeenRevalidated(tags, lastModified);
}
// TODO: refactor this, we should introduce a new method in the tagCache interface so that both implementations use hasBeenRevalidated
const _lastModified = await globalThis.tagCache.getLastModified(
Expand Down
Loading