mirror of
https://github.com/darkwire/darkwire.io.git
synced 2025-07-18 10:49:02 +00:00
Cache html for one minute (#102)
This commit is contained in:
parent
f9aa9dc103
commit
57691fdb2b
@ -87,7 +87,7 @@ if (clientDistDirectory) {
|
|||||||
app.use(async (ctx, next) => {
|
app.use(async (ctx, next) => {
|
||||||
setStaticFileHeaders(ctx);
|
setStaticFileHeaders(ctx);
|
||||||
await koaStatic(clientDistDirectory, {
|
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);
|
})(ctx, next);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user