From 1a89830880cda4204c7e5070e1f20ad34d608b66 Mon Sep 17 00:00:00 2001 From: Rohan Kumar Date: Sat, 26 Dec 2020 20:43:48 -0800 Subject: [PATCH] Compress more when deploying to prod Use 50 zopfli zopfli iterations when compressing for staging, but a full 1200 when compressing for prod. --- .build.yml | 7 ++++--- Makefile | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.build.yml b/.build.yml index e08e914..b33050a 100644 --- a/.build.yml +++ b/.build.yml @@ -8,7 +8,7 @@ packages: - npm # for testing with lighthouse and webhint - chromium # for testing with lighthouse and webhint environment: - HINT_TELEMETRY: off + HINT_TELEMETRY: "off" sources: - https://git.sr.ht/~seirdy/seirdy.one secrets: @@ -24,11 +24,12 @@ tasks: mkdir -p ~/bin tar x -ozC ~/bin -f binaries.tar.gz cd seirdy.one - npm i -D + npm i -D --no-fund - build_deploy: | cd seirdy.one export PATH=~/bin:$PATH - make DOMAIN=staging.seirdy.one test-staging + # don't spend as much time compressing for staging. + make DOMAIN=staging.seirdy.one ZOPFLI_ITERATIONS=50 test-staging tar czf ~/lighthouse-reports.tar.gz lighthouse-reports make clean deploy artifacts: diff --git a/Makefile b/Makefile index b25e83b..8464618 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,7 @@ GEMINI_RSYNC_DEST = $(USER):$(GEMINI_ROOT) OUTPUT_DIR = public RSYNCFLAGS += -rlvz --zc=zstd +ZOPFLI_ITERATIONS=1200 # max compression .PHONY: hugo hugo: clean @@ -65,7 +66,7 @@ build: hugo ifndef NO_GZIP_STATIC find $(OUTPUT_DIR) -type f -name '*.html' -o -name '*.css' -o -name '*.xml' -o -name '*.txt' -o -name '*.webmanifest' \ | grep -v gemini \ - | xargs zopfli --i50 --gzip + | xargs zopfli --i$(ZOPFLI_ITERATIONS) --gzip endif