Use MDN recommendation for preventing SW caching

This commit is contained in:
Rich Harris
2018-09-08 10:12:55 -04:00
committed by GitHub
parent 5ee53a98c6
commit cbb5e8755b

View File

@@ -141,12 +141,12 @@ export default function middleware(opts: {
fs.existsSync(path.join(output, 'service-worker.js')) && serve({
pathname: '/service-worker.js',
cache_control: 'max-age=0'
cache_control: 'no-cache, no-store, must-revalidate'
}),
fs.existsSync(path.join(output, 'service-worker.js.map')) && serve({
pathname: '/service-worker.js.map',
cache_control: 'max-age=0'
cache_control: 'no-cache, no-store, must-revalidate'
}),
serve({