configurable gzip compression, defaults to false

This commit is contained in:
Miraty 2024-02-10 14:10:49 +01:00
parent 66df795d25
commit cd780914d4
1 changed files with 3 additions and 2 deletions

View File

@ -39,6 +39,7 @@ $config['center-index'] ??= false;
$config['default-lang'] ??= NULL;
$config['announce-css'] ??= false;
$config['announce-feed'] ??= false;
$config['gzip'] ??= false;
if (!isset($config['id'])) {
$config['id'] = bin2hex(random_bytes(32));
@ -261,8 +262,8 @@ foreach ($pages as $node) {
file_put_contents($base_filepath_target . '.html', $content);
// Gzip compression
exec('gzip --keep --fast --force ' . $base_filepath_target . '.html');
if ($config['gzip'])
exec('gzip --keep --fast --force ' . $base_filepath_target . '.html');
}
if ($page_names[$src] === 'index')