Created
May 5, 2011 09:53
-
-
Save jinzhu/956813 to your computer and use it in GitHub Desktop.
gzip script (used for nginx)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
cp $1 $1.tmp | |
## Remove the old gz if there is one | |
rm -rf $1.gz | |
## Compress the tmp HTML copy. Use the highest level 9 | |
## compression and do not store dates or file names | |
## in the gzip header. BTW, if the compressed gz is | |
## larger then the original file a gzip will NOT be made. | |
gzip -9 $1.tmp -c > $1.gz | |
## Clean up any tmp files | |
rm -rf $1.tmp | |
echo "" | |
echo "Verify files" | |
ls -al $1* | |
echo "" | |
echo "Compression statistics" | |
gzip -vl $1.gz |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://calomel.org/nginx.html