use consistent cache-control:max-age=600 for HTML pages

This commit is contained in:
Nolan Lawson
2018-09-07 16:46:40 -07:00
parent 0e8ed6612c
commit 2d1f535314

View File

@@ -136,7 +136,7 @@ export default function middleware(opts: {
fs.existsSync(path.join(output, 'index.html')) && serve({
pathname: '/index.html',
cache_control: 'max-age=600'
cache_control: dev() ? 'no-cache' : 'max-age=600'
}),
fs.existsSync(path.join(output, 'service-worker.js')) && serve({
@@ -532,6 +532,7 @@ function get_page_handler(
.replace('%sapper.styles%', () => styles);
res.statusCode = status;
res.setHeader('Cache-Control', dev() ? 'no-cache' : 'max-age=600');
res.end(body);
}).catch(err => {
if (error) {