performance: maxAge for favicon and plugin definitions (#4761)

This commit is contained in:
John McLear 2021-02-13 08:13:48 +00:00 committed by GitHub
parent 09e9c36098
commit 483f4344c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View file

@ -65,7 +65,8 @@ exports.expressCreateServer = async (hookName, args) => {
clientPlugins[name] = {...plugins.plugins[name]};
delete clientPlugins[name].package;
}
res.header('Content-Type', 'application/json; charset=utf-8');
res.setHeader('Content-Type', 'application/json; charset=utf-8');
res.setHeader('Cache-Control', `public, max-age=${settings.maxAge}`);
res.write(JSON.stringify({plugins: clientPlugins, parts: clientParts}));
res.end();
});