mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
fix(core): Use Custom cache-control headers force cache-revalidation on /types/*.json (no-changelog) (#9981)
This commit is contained in:
committed by
GitHub
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,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user