Skip to content

Commit 13ebc04

Browse files
committed
fix: ttl parsing
1 parent 35eb96f commit 13ebc04

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/templates/getHandler.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ const makeHandler =
123123
let maxAge
124124
for (const part of parts) {
125125
const [key, value] = part.split('=')
126-
if (key?.trim() === 's-max-age') {
126+
if (key?.trim() === 's-maxage') {
127127
maxAge = value?.trim()
128128
}
129129
}
@@ -166,6 +166,8 @@ const makeHandler =
166166

167167
// Sending SWR headers causes undefined behaviour with the Netlify CDN
168168
const cacheHeader = multiValueHeaders['cache-control']?.[0]
169+
multiValueHeaders['x-next-cache-header'] = [cacheHeader]
170+
169171
if (cacheHeader?.includes('stale-while-revalidate')) {
170172
if (mode === 'odb' && process.env.EXPERIMENTAL_ODB_TTL) {
171173
mode = 'isr'

0 commit comments

Comments
 (0)