mirror of
https://github.com/darkwire/darkwire.io.git
synced 2025-07-18 18:54:52 +00:00
Cache static assets for one year (#83)
* Cache static assets for one year * Use milliseconds
This commit is contained in:
parent
fa19b5098d
commit
a8f479c56e
@ -86,7 +86,9 @@ const clientDistDirectory = process.env.CLIENT_DIST_DIRECTORY;
|
||||
if (clientDistDirectory) {
|
||||
app.use(async (ctx, next) => {
|
||||
setStaticFileHeaders(ctx);
|
||||
await koaStatic(clientDistDirectory)(ctx, next);
|
||||
await koaStatic(clientDistDirectory, {
|
||||
maxage: 365 * 24 * 60 * 60 * 1000 // one year in milliseconds
|
||||
})(ctx, next);
|
||||
});
|
||||
|
||||
app.use(async (ctx) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user