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(generalLimiter);
|
||||||
app.use('/api', apiKeyGuard);
|
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('/css', express.static(path.join(PUBLIC_DIR, 'css'), staticOpts));
|
||||||
app.use('/js', express.static(path.join(PUBLIC_DIR, 'js'), staticOpts));
|
app.use('/js', express.static(path.join(PUBLIC_DIR, 'js'), staticOpts));
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
client_max_body_size 55m;
|
client_max_body_size 55m;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_buffering off;
|
||||||
|
proxy_cache off;
|
||||||
|
|||||||
Reference in New Issue
Block a user