Skip to content

Commit

Permalink
fix(cache): invalidate wrongly cached handler entities (#1857)
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Oct 26, 2023
1 parent b0ec181 commit 55d60b8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/runtime/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,13 @@ export function defineCachedEventHandler<
if (entry.value.body === undefined) {
return false;
}
// https://github.com/unjs/nitro/pull/1857
if (
entry.value.headers.etag === "undefined" ||
entry.value.headers["last-modified"] === "undefined"
) {
return false;
}
return true;
},
group: opts.group || "nitro/handlers",
Expand Down

0 comments on commit 55d60b8

Please sign in to comment.