Server: add cache to static files
This commit is contained in:
parent
f253b1c1f1
commit
c731ee4efd
|
@ -75,15 +75,15 @@ app.use('/client/*', function (req, res, next) {
|
||||||
})
|
})
|
||||||
|
|
||||||
const torrentsPhysicalPath = path.join(__dirname, config.get('storage.torrents'))
|
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
|
// Videos path for webseeding
|
||||||
const videosPhysicalPath = path.join(__dirname, config.get('storage.videos'))
|
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
|
// Thumbnails path for express
|
||||||
const thumbnailsPhysicalPath = path.join(__dirname, config.get('storage.thumbnails'))
|
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
|
// Client application
|
||||||
app.use('/*', function (req, res, next) {
|
app.use('/*', function (req, res, next) {
|
||||||
|
|
Loading…
Reference in New Issue