feat: #8801, disable express compression by default

v1.18.x
Barış Soner Uşaklı 4 years ago
parent cc1c722092
commit 6ac73ccb7e

@ -134,5 +134,6 @@
"necroThreshold": 7,
"categoryWatchState": "watching",
"submitPluginUsage": 1,
"maxUserSessions": 10
"maxUserSessions": 10,
"useCompression": 0
}

@ -36,5 +36,8 @@
"analytics.settings": "Analytics Settings",
"analytics.max-cache": "Analytics Cache Max Value",
"analytics.max-cache-help": "On high-traffic installs, the cache could be exhausted continuously if there are more concurrent active users than the Max Cache value. (Restart required)"
"analytics.max-cache-help": "On high-traffic installs, the cache could be exhausted continuously if there are more concurrent active users than the Max Cache value. (Restart required)",
"compression.settings": "Compression Settings",
"compression.enable": "Enable Compression",
"compression.help": "This setting enables gzip compression. For a high-traffic website in production, the best way to put compression in place is to implement it at a reverse proxy level. You can enable it here for testing purposes."
}

@ -165,4 +165,23 @@
</div>
</div>
<div class="row">
<div class="col-sm-2 col-xs-12 settings-header">[[admin/settings/advanced:compression.settings]]</div>
<div class="col-sm-10 col-xs-12">
<form>
<div class="form-group">
<p class="help-block">
[[admin/settings/advanced:compression.help]]
</p>
<div class="checkbox">
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect">
<input class="mdl-switch__input" type="checkbox" data-field="useCompression">
<span class="mdl-switch__label"><strong>[[admin/settings/advanced:compression.enable]]</strong></span>
</label>
</div>
</div>
</form>
</div>
</div>
<!-- IMPORT admin/partials/settings/footer.tpl -->

@ -13,7 +13,6 @@ var server;
var winston = require('winston');
var async = require('async');
var flash = require('connect-flash');
var compression = require('compression');
var bodyParser = require('body-parser');
var cookieParser = require('cookie-parser');
var session = require('express-session');
@ -134,7 +133,10 @@ function setupExpressApp(app) {
app.enable('minification');
}
app.use(compression());
if (meta.config.useCompression) {
const compression = require('compression');
app.use(compression());
}
app.get(relativePath + '/ping', pingController.ping);
app.get(relativePath + '/sping', pingController.ping);

Loading…
Cancel
Save