fix: disable all static file caching to prevent stale assets
This commit is contained in:
@@ -70,7 +70,12 @@ app.use(sanitizeBody);
|
||||
app.use(generalLimiter);
|
||||
app.use('/api', apiKeyGuard);
|
||||
|
||||
const staticOpts = { maxAge: '1h', setHeaders: (res, p) => { if (p.endsWith('.html')) res.setHeader('Cache-Control', 'no-cache'); } };
|
||||
const staticOpts = {
|
||||
maxAge: 0,
|
||||
setHeaders: (res, p) => {
|
||||
res.setHeader('Cache-Control', 'no-cache, no-store, must-revalidate');
|
||||
},
|
||||
};
|
||||
app.use('/css', express.static(path.join(PUBLIC_DIR, 'css'), staticOpts));
|
||||
app.use('/js', express.static(path.join(PUBLIC_DIR, 'js'), staticOpts));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user