adjust compression to optimize for speed

This commit is contained in:
Chris Lu
2019-04-07 11:01:28 -07:00
parent c731d9be6d
commit a32abda1a3
2 changed files with 3 additions and 2 deletions

View File

@@ -72,7 +72,7 @@ func IsGzippableFileType(ext, mtype string) (shouldBeZipped, iAmSure bool) {
func GzipData(input []byte) ([]byte, error) {
buf := new(bytes.Buffer)
w, _ := gzip.NewWriterLevel(buf, flate.BestCompression)
w, _ := gzip.NewWriterLevel(buf, flate.BestSpeed)
if _, err := w.Write(input); err != nil {
glog.V(2).Infoln("error compressing data:", err)
return nil, err