Improve compress.sh and add brotli

This commit is contained in:
BBaoVanC 2021-05-29 19:37:41 -05:00
parent 996955eb46
commit 21cf60e198
Signed by: bbaovanc
GPG Key ID: 18089E4E3CCF1D3A
1 changed files with 17 additions and 3 deletions

View File

@ -1,4 +1,18 @@
for f in $(find public/ -name "*.html" -o -name "*.xml" -o -name "*.css" -o -name "*.js"); do
echo "Compressing $f..."
gzip -nk $f
#!/bin/sh
files=$(find public/ -name "*.html" -o -name "*.xml" -o -name "*.css" -o -name "*.js")
for f in $files; do
( gzip -fnk "$f" && echo "GZIP $f" ) &
done
wait
echo "gzip done, starting brotli"
for f in $files; do
( brotli -fZk "$f" && echo "BROTLI $f" ) &
done
wait
echo "broli done"