Cache html for one minute (#102)

This commit is contained in:
Alan Friedman 2019-08-25 14:59:28 -04:00 committed by GitHub
parent f9aa9dc103
commit 57691fdb2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -87,7 +87,7 @@ if (clientDistDirectory) {
app.use(async (ctx, next) => {
setStaticFileHeaders(ctx);
await koaStatic(clientDistDirectory, {
maxage: 365 * 24 * 60 * 60 * 1000 // one year in milliseconds
maxage: ctx.req.url === '/' ? 60 * 1000 : 365 * 24 * 60 * 60 * 1000 // one minute in ms for html doc, one year for css, js, etc
})(ctx, next);
});