From 76efbb84794e7647ddc991a42e64382201d4e804 Mon Sep 17 00:00:00 2001 From: Rohan Kumar Date: Wed, 24 Feb 2021 13:15:49 -0800 Subject: [PATCH] CI: speed up static gzip+zopfli compression Compress RSS feeds with fewer iterations since their files are larger. --- Makefile | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 7b0525b..998bf31 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,9 @@ GEMINI_RSYNC_DEST = $(USER):$(GEMINI_ROOT) OUTPUT_DIR = public RSYNCFLAGS += -rlvz --zc=zstd -ZOPFLI_ITERATIONS=500 # max compression +# max compression +ZOPFLI_ITERATIONS=500 +ZOPFLI_ITERATIONS_LARGE=75 .PHONY: hugo hugo: clean @@ -63,9 +65,13 @@ test: lint-css hint-devserver check-links .PHONY: build build: hugo -# gzip_static + max zopfli compression +# gzip_static + max zopfli compression + brotli_static ifndef NO_STATIC - find $(OUTPUT_DIR) -type f -name '*.html' -o -name '*.css' -o -name '*.xml' -o -name '*.txt' -o -name '*.asc' -o -name '*.webmanifest' -o -name "*.svg" \ + # compress RSS feeds separately, with fewer iterations since they're bigger + find $(OUTPUT_DIR) -type f -name '*.xml' \ + | grep -v gemini \ + | xargs zopfli --i$(ZOPFLI_ITERATIONS_LARGE) --gzip + find $(OUTPUT_DIR) -type f -name '*.html' -o -name '*.css' -o -name '*.txt' -o -name '*.asc' -o -name '*.webmanifest' -o -name "*.svg" \ | grep -v gemini \ | xargs zopfli --i$(ZOPFLI_ITERATIONS) --gzip find $(OUTPUT_DIR) -type f -name '*.html' -o -name '*.css' -o -name '*.xml' -o -name '*.txt' -o -name '*.asc' -o -name '*.webmanifest' -o -name "*.svg" \