Skip to content

Commit ef2da0d

Browse files
authored
fix: ensure stale-while-revalidate headers are not sent (#737)
1 parent 9fbd82e commit ef2da0d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/templates/getHandler.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,11 @@ const makeHandler =
136136
multiValueHeaders['cache-control'] = ['no-cache']
137137
}
138138

139+
// Sending SWR headers causes undefined behaviour with the Netlify CDN
140+
if (multiValueHeaders['cache-control']?.[0]?.includes('stale-while-revalidate')) {
141+
multiValueHeaders['cache-control'] = ['public, max-age=0, must-revalidate']
142+
}
143+
139144
return {
140145
...result,
141146
multiValueHeaders,

0 commit comments

Comments
 (0)