From c731ee4efdbc3c6e867b024110fc12aac326f543 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 21 Oct 2016 12:24:29 +0200 Subject: Server: add cache to static files --- server.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server.js b/server.js index b2d9be9aa..f24b25f4d 100644 --- a/server.js +++ b/server.js @@ -75,15 +75,15 @@ app.use('/client/*', function (req, res, next) { }) const torrentsPhysicalPath = path.join(__dirname, config.get('storage.torrents')) -app.use(constants.STATIC_PATHS.TORRENTS, cors(), express.static(torrentsPhysicalPath, { maxAge: 0 })) +app.use(constants.STATIC_PATHS.TORRENTS, cors(), express.static(torrentsPhysicalPath, { maxAge: '7d' })) // Videos path for webseeding const videosPhysicalPath = path.join(__dirname, config.get('storage.videos')) -app.use(constants.STATIC_PATHS.WEBSEED, cors(), express.static(videosPhysicalPath, { maxAge: 0 })) +app.use(constants.STATIC_PATHS.WEBSEED, cors(), express.static(videosPhysicalPath, { maxAge: '7d' })) // Thumbnails path for express const thumbnailsPhysicalPath = path.join(__dirname, config.get('storage.thumbnails')) -app.use(constants.STATIC_PATHS.THUMBNAILS, express.static(thumbnailsPhysicalPath, { maxAge: 0 })) +app.use(constants.STATIC_PATHS.THUMBNAILS, express.static(thumbnailsPhysicalPath, { maxAge: '7d' })) // Client application app.use('/*', function (req, res, next) { -- cgit v1.2.3