Force PWA updates before push registration
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user