Force PWA updates before push registration

This commit is contained in:
Dorian
2026-05-15 14:31:55 -05:00
parent 8e2136f304
commit be69dd97e7
3 changed files with 19 additions and 3 deletions

View File

@@ -469,7 +469,11 @@ const serveStatic = (req, res) => {
'.json': 'application/json',
'.webmanifest': 'application/manifest+json',
}
res.writeHead(200, { 'Content-Type': types[ext] || 'application/octet-stream' })
const headers = { 'Content-Type': types[ext] || 'application/octet-stream' }
if (path.basename(safePath) === 'sw.js' || ext === '.html' || ext === '.webmanifest') {
headers['Cache-Control'] = 'no-store'
}
res.writeHead(200, headers)
createReadStream(safePath).pipe(res)
}