From 6ab5ae6dfb917e583aaae8f46553ff7dc771604a Mon Sep 17 00:00:00 2001 From: Joe Mooring Date: Fri, 25 Jul 2025 12:28:11 -0700 Subject: [PATCH] content: Improve GitLab Pages compression performance --- content/en/host-and-deploy/host-on-gitlab-pages.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/content/en/host-and-deploy/host-on-gitlab-pages.md b/content/en/host-and-deploy/host-on-gitlab-pages.md index 36bdf44c8..59c1d1e0b 100644 --- a/content/en/host-and-deploy/host-on-gitlab-pages.md +++ b/content/en/host-and-deploy/host-on-gitlab-pages.md @@ -59,8 +59,9 @@ pages: # Build - hugo --gc --minify --baseURL ${CI_PAGES_URL} # Compress - - find public -type f -regex '.*\.\(css\|html\|js\|txt\|xml\)$' -exec gzip -f -k {} \; - - find public -type f -regex '.*\.\(css\|html\|js\|txt\|xml\)$' -exec brotli -f -k {} \; + - find public/ -type f -regextype posix-extended -regex '.+\.(css|html|js|json|mjs|svg|txt|xml)$' -print0 > files.txt + - time xargs --null --max-procs=0 --max-args=1 brotli --quality=10 --force --keep < files.txt + - time xargs --null --max-procs=0 --max-args=1 gzip -9 --force --keep < files.txt artifacts: paths: - public