diff --git a/server.js b/server.js index 2f0019b..d0075b6 100644 --- a/server.js +++ b/server.js @@ -216,9 +216,17 @@ app.get('/uploads/thumb/:name', fileLimiter, async (req, res) => { return sendImageThumb(res, fp); }); +app.use((req, res, next) => { + const p = req.path; + if (!p.startsWith('/uploads') && !p.startsWith('/vendor')) { + res.setHeader('Cache-Control', 'no-cache'); + } + next(); +}); + app.use('/uploads', express.static(path.join(__dirname, 'uploads'), { maxAge: '365d', immutable: true })); app.use('/vendor', express.static(path.join(__dirname, 'public', 'vendor'), { maxAge: '30d' })); -app.use(express.static(path.join(__dirname, 'public'), { maxAge: '1h' })); +app.use(express.static(path.join(__dirname, 'public'))); const SESSION_TTL_MS = 30 * 24 * 60 * 60 * 1000;