Skip to content

Commit 55d60b8

Browse files
authored
fix(cache): invalidate wrongly cached handler entities (#1857)
1 parent b0ec181 commit 55d60b8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/runtime/cache.ts

+7
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,13 @@ export function defineCachedEventHandler<
257257
if (entry.value.body === undefined) {
258258
return false;
259259
}
260+
// https://github.com/unjs/nitro/pull/1857
261+
if (
262+
entry.value.headers.etag === "undefined" ||
263+
entry.value.headers["last-modified"] === "undefined"
264+
) {
265+
return false;
266+
}
260267
return true;
261268
},
262269
group: opts.group || "nitro/handlers",

0 commit comments

Comments
 (0)