performance: maxAge for favicon and plugin definitions (#4761)
parent
09e9c36098
commit
483f4344c2
|
@ -83,7 +83,7 @@ exports.expressCreateServer = (hookName, args, cb) => {
|
|||
settings.skinName,
|
||||
'favicon.ico'
|
||||
);
|
||||
|
||||
res.setHeader('Cache-Control', `public, max-age=${settings.maxAge}`);
|
||||
res.sendFile(filePath, (err) => {
|
||||
// there is no custom favicon, send the default favicon
|
||||
if (err) {
|
||||
|
|
|
@ -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();
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue