don't set cache header on serviceWorker.js
This commit is contained in:
parent
5677390a45
commit
1a78f57515
4 changed files with 4117 additions and 8726 deletions
|
@ -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');
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue