mirror of
https://github.com/n8n-io/n8n.git
synced 2024-09-11 13:15:28 +03: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();
|
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(
|
this.app.use(
|
||||||
'/',
|
'/',
|
||||||
express.static(staticCacheDir, cacheOptions),
|
express.static(staticCacheDir, {
|
||||||
|
...cacheOptions,
|
||||||
|
setHeaders: setCustomCacheHeader,
|
||||||
|
}),
|
||||||
express.static(EDITOR_UI_DIST_DIR, cacheOptions),
|
express.static(EDITOR_UI_DIST_DIR, cacheOptions),
|
||||||
historyApiHandler,
|
historyApiHandler,
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user