هذه المقالة كتبت على مدونتي هنا اولا
إذا تستخدم خادم ويب مثل مثلا Caddy, قد تريد ضغط موقعك قبل رفعة للخادم يدويا, لإنه لا يدعم الضغط بنفسه لصيغة Brotli.
Brotli
find public -type f \( -name '*.html' -o -name '*.js' -o -name '*.css' -o -name '*.xml' -o -name '*.svg' \) \
-exec /bin/sh -c 'brotli -q 11 -o "$1.br" "$1"' /bin/sh {} \;
Gzip
find public -type f \( -name '*.html' -o -name '*.js' -o -name '*.css' -o -name '*.xml' -o -name '*.svg' \) \
-exec /bin/sh -c 'gzip -v -f -9 -c "$1" > "$1.gz"' /bin/sh {} \;
المصدر
https://fariszr.com/compress-static-site-brotli-gzip/#المصدر