Skip to content

Commit a6d9f9b

Browse files
authored
Merge pull request #6081 from dunglas/fix/encode-match
2 parents e1aa862 + 2348ac8 commit a6d9f9b

File tree

1 file changed

+30
-4
lines changed

1 file changed

+30
-4
lines changed

modules/caddyhttp/encode/encode.go

+30-4
Original file line numberDiff line numberDiff line change
@@ -84,17 +84,43 @@ func (enc *Encode) Provision(ctx caddy.Context) error {
8484

8585
if enc.Matcher == nil {
8686
// common text-based content types
87+
// list based on https://developers.cloudflare.com/speed/optimization/content/brotli/content-compression/#compression-between-cloudflare-and-website-visitors
8788
enc.Matcher = &caddyhttp.ResponseMatcher{
8889
Headers: http.Header{
8990
"Content-Type": []string{
90-
"text/*",
91-
"application/json*",
92-
"application/javascript*",
93-
"application/xhtml+xml*",
9491
"application/atom+xml*",
92+
"application/eot*",
93+
"application/font*",
94+
"application/geo+json*",
95+
"application/graphql+json*",
96+
"application/javascript*",
97+
"application/json*",
98+
"application/ld+json*",
99+
"application/manifest+json*",
100+
"application/opentype*",
101+
"application/otf*",
95102
"application/rss+xml*",
103+
"application/truetype*",
104+
"application/ttf*",
105+
"application/vnd.api+json*",
106+
"application/vnd.ms-fontobject*",
96107
"application/wasm*",
108+
"application/x-httpd-cgi*",
109+
"application/x-javascript*",
110+
"application/x-opentype*",
111+
"application/x-otf*",
112+
"application/x-perl*",
113+
"application/x-protobuf*",
114+
"application/x-ttf*",
115+
"application/xhtml+xml*",
116+
"application/xml*",
117+
"font/*",
97118
"image/svg+xml*",
119+
"image/vnd.microsoft.icon*",
120+
"image/x-icon*",
121+
"multipart/bag*",
122+
"multipart/mixed*",
123+
"text/*",
98124
},
99125
},
100126
}

0 commit comments

Comments
 (0)