diff --git a/server/server.js b/server/server.js index bfd08949..f2b938c7 100644 --- a/server/server.js +++ b/server/server.js @@ -57,7 +57,9 @@ app.options('*', corsMiddleware); // Body parser, cookie parser, sessions, serve public assets -app.use(Express.static(path.resolve(__dirname, '../static'))); +app.use(Express.static(path.resolve(__dirname, '../static'), { + maxAge: process.env.STATIC_MAX_AGE || (process.env.NODE_ENV === 'production' ? '1d' : '0') +})); app.use(bodyParser.urlencoded({ limit: '50mb', extended: true })); app.use(bodyParser.json({ limit: '50mb' })); app.use(cookieParser());