diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-10-21 12:24:29 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-10-21 12:24:29 +0200 |
commit | c731ee4efdbc3c6e867b024110fc12aac326f543 (patch) | |
tree | 214b4181eeb49c1befe5fd8b9c911f04e7cb5f2a /server.js | |
parent | f253b1c1f19d9cb056ab95b2cb6208952e073894 (diff) | |
download | PeerTube-c731ee4efdbc3c6e867b024110fc12aac326f543.tar.gz PeerTube-c731ee4efdbc3c6e867b024110fc12aac326f543.tar.zst PeerTube-c731ee4efdbc3c6e867b024110fc12aac326f543.zip |
Server: add cache to static files
Diffstat (limited to 'server.js')
-rw-r--r-- | server.js | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -75,15 +75,15 @@ app.use('/client/*', function (req, res, next) { | |||
75 | }) | 75 | }) |
76 | 76 | ||
77 | const torrentsPhysicalPath = path.join(__dirname, config.get('storage.torrents')) | 77 | const torrentsPhysicalPath = path.join(__dirname, config.get('storage.torrents')) |
78 | app.use(constants.STATIC_PATHS.TORRENTS, cors(), express.static(torrentsPhysicalPath, { maxAge: 0 })) | 78 | app.use(constants.STATIC_PATHS.TORRENTS, cors(), express.static(torrentsPhysicalPath, { maxAge: '7d' })) |
79 | 79 | ||
80 | // Videos path for webseeding | 80 | // Videos path for webseeding |
81 | const videosPhysicalPath = path.join(__dirname, config.get('storage.videos')) | 81 | const videosPhysicalPath = path.join(__dirname, config.get('storage.videos')) |
82 | app.use(constants.STATIC_PATHS.WEBSEED, cors(), express.static(videosPhysicalPath, { maxAge: 0 })) | 82 | app.use(constants.STATIC_PATHS.WEBSEED, cors(), express.static(videosPhysicalPath, { maxAge: '7d' })) |
83 | 83 | ||
84 | // Thumbnails path for express | 84 | // Thumbnails path for express |
85 | const thumbnailsPhysicalPath = path.join(__dirname, config.get('storage.thumbnails')) | 85 | const thumbnailsPhysicalPath = path.join(__dirname, config.get('storage.thumbnails')) |
86 | app.use(constants.STATIC_PATHS.THUMBNAILS, express.static(thumbnailsPhysicalPath, { maxAge: 0 })) | 86 | app.use(constants.STATIC_PATHS.THUMBNAILS, express.static(thumbnailsPhysicalPath, { maxAge: '7d' })) |
87 | 87 | ||
88 | // Client application | 88 | // Client application |
89 | app.use('/*', function (req, res, next) { | 89 | app.use('/*', function (req, res, next) { |