Files
VPS-scripts_Ubuntu-Web-V1/PreComp-example.sh
2019-01-24 11:50:10 +01:00

14 lines
564 B
Bash

#setting Variables
domain=
nginxfolder=/var/www/${domain}
outputfolder=/tmp/brotli/${domain}
##No modifing
minify -r -o $outputfolder/ $nginxfolder
find $outputfolder/ -type f \( -name '*.html' -o -name '*.js' -o -name '*.json' -o -name '*.htm' -o -name '*.css' -o -name '*.xml' -o -name '*.svg' \) -exec brotli -v -k -f --best {} \;
find $outputfolder/ -type f \( -name '*.html' -o -name '*.js' -o -name '*.json' -o -name '*.htm' -o -name '*.css' -o -name '*.xml' -o -name '*.svg' \) -exec gzip -v -k -f --best {} \;
cp $outputfolder/*.{br,gz} $nginxfolder/