Skip to content

Commit 45f3a0a

Browse files
committed
fix: apply code review comments/suggestions
1 parent 87fe9b4 commit 45f3a0a

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/run/handlers/cache.cts

+3-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ export class NetlifyCacheHandler implements CacheHandlerForMultipleVersions {
6767
const revalidateAfter = revalidate * 1_000 + blob.lastModified
6868
return (revalidateAfter - Date.now()) / 1_000
6969
}
70-
return revalidate === false ? 'PERMANENT' : 'NOT SET'
70+
if (revalidate === false) {
71+
return 'PERMANENT'
72+
}
7173
}
7274

7375
return 'NOT SET'

src/run/handlers/server.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,14 @@ export default async (
112112
}
113113

114114
const nextCache = response.headers.get('x-nextjs-cache')
115-
const isServedFromCache = nextCache === 'HIT' || nextCache === 'STALE'
115+
const isServedFromNextCache = nextCache === 'HIT' || nextCache === 'STALE'
116116

117117
topLevelSpan.setAttributes({
118118
'x-nextjs-cache': nextCache ?? undefined,
119-
isServedFromCache,
119+
isServedFromNextCache,
120120
})
121121

122-
if (isServedFromCache) {
122+
if (isServedFromNextCache) {
123123
await adjustDateHeader({
124124
headers: response.headers,
125125
request,

0 commit comments

Comments
 (0)