From cd780914d4ec3a9c62db06dd37f00364b6c813db Mon Sep 17 00:00:00 2001 From: Miraty Date: Sat, 10 Feb 2024 14:10:49 +0100 Subject: [PATCH] configurable gzip compression, defaults to false --- mkht.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mkht.php b/mkht.php index 518ac66..b6ad549 100755 --- a/mkht.php +++ b/mkht.php @@ -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')