From 6a502dffe2ea43b58bde158b6ac15b652e2faa39 Mon Sep 17 00:00:00 2001 From: bprieshof Date: Thu, 24 Jan 2019 11:50:10 +0100 Subject: [PATCH] Add 'PreComp-example.sh' --- PreComp-example.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 PreComp-example.sh diff --git a/PreComp-example.sh b/PreComp-example.sh new file mode 100644 index 0000000..c11ee7b --- /dev/null +++ b/PreComp-example.sh @@ -0,0 +1,14 @@ +#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/ \ No newline at end of file