don't set cache header on serviceWorker.js

This commit is contained in:
Danny Coates 2018-07-12 20:48:07 -07:00
parent 5677390a45
commit 1a78f57515
No known key found for this signature in database
GPG key ID: 4C442633C62E00CB
4 changed files with 4117 additions and 8726 deletions

View file

@ -18,8 +18,10 @@ routes(app);
app.use(
express.static(path.resolve(__dirname, '../../dist/'), {
setHeaders: function(res) {
res.set('Cache-Control', 'public, max-age=31536000, immutable');
setHeaders: function(res, path) {
if (!/serviceWorker\.js$/.test(path)) {
res.set('Cache-Control', 'public, max-age=31536000, immutable');
}
res.removeHeader('Pragma');
}
})