mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-13 01:15:47 +01:00
performance improvements (#8795)
* perf: nconf/winston/render cache nconf.get calls modify middleware.pageView to call next earlier don't call winston.verbose on every hook see https://github.com/winstonjs/winston/issues/1669 translate header/footer separately and cache results for guests * fix: copy paste fail * refactor: style and fire hook only log in dev mode * fix: cache key, header changes based on template * perf: change replace * fix: add missing await * perf: category * perf: lodash clone * perf: remove escapeRegexChars
This commit is contained in:
committed by
GitHub
parent
822c13f199
commit
a05905f196
@@ -95,6 +95,11 @@ function loadConfig(configFile) {
|
||||
nconf.set('use_port', !!urlObject.port);
|
||||
nconf.set('relative_path', relativePath);
|
||||
nconf.set('port', nconf.get('PORT') || nconf.get('port') || urlObject.port || (nconf.get('PORT_ENV_VAR') ? nconf.get(nconf.get('PORT_ENV_VAR')) : false) || 4567);
|
||||
|
||||
// cookies don't provide isolation by port: http://stackoverflow.com/a/16328399/122353
|
||||
const domain = nconf.get('cookieDomain') || urlObject.hostname;
|
||||
const origins = nconf.get('socket.io:origins') || `${urlObject.protocol}//${domain}:*`;
|
||||
nconf.set('socket.io:origins', origins);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user