Stop gzip more file types: Text, MD
This commit is contained in:
@@ -280,6 +280,12 @@ func getMimeTypeByExtension(ext string) string {
|
|||||||
case ".md":
|
case ".md":
|
||||||
return "text/markdown"
|
return "text/markdown"
|
||||||
|
|
||||||
|
case ".map":
|
||||||
|
return "text/plain"
|
||||||
|
|
||||||
|
case ".txt":
|
||||||
|
return "text/plain"
|
||||||
|
|
||||||
case ".woff":
|
case ".woff":
|
||||||
return "application/font-woff"
|
return "application/font-woff"
|
||||||
|
|
||||||
@@ -318,6 +324,8 @@ func parseFile(
|
|||||||
// Don't compress images
|
// Don't compress images
|
||||||
} else if strings.HasPrefix(mimeType, "application/font-woff") {
|
} else if strings.HasPrefix(mimeType, "application/font-woff") {
|
||||||
// Don't compress web fonts
|
// Don't compress web fonts
|
||||||
|
} else if mimeType == "text/plain" {
|
||||||
|
// Don't compress plain text
|
||||||
} else {
|
} else {
|
||||||
compressed := bytes.NewBuffer(make([]byte, 0, 1024))
|
compressed := bytes.NewBuffer(make([]byte, 0, 1024))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user