mirror of
https://github.com/n8n-io/n8n.git
synced 2025-02-21 02:56:40 -08:00
fix(core): Use Custom cache-control headers force cache-revalidation on /types/*.json
(no-changelog) (#9981)
This commit is contained in:
parent
0f495986f8
commit
761229e4d2
|
@ -364,10 +364,18 @@ export class Server extends AbstractServer {
|
|||
next();
|
||||
}
|
||||
};
|
||||
const setCustomCacheHeader = (res: express.Response) => {
|
||||
if (/^\/types\/(nodes|credentials).json$/.test(res.req.url)) {
|
||||
res.setHeader('Cache-Control', 'no-cache, must-revalidate');
|
||||
}
|
||||
};
|
||||
|
||||
this.app.use(
|
||||
'/',
|
||||
express.static(staticCacheDir, cacheOptions),
|
||||
express.static(staticCacheDir, {
|
||||
...cacheOptions,
|
||||
setHeaders: setCustomCacheHeader,
|
||||
}),
|
||||
express.static(EDITOR_UI_DIST_DIR, cacheOptions),
|
||||
historyApiHandler,
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue