Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS
Mirrored from https://github.com/Slazee/caddy.git
Synced Nov 12, 18:15 UTC
fix: add more media types to the compressed by default list
Kévin Dunglas committed
Feb 4, 2024 at 23:28 UTC
b8f729b88fccfd4d5178269df62a56722a37b5d4
1 file changed
+46
-4
modules/caddyhttp/encode/encode.go
+46
-4
@@ -84,17 +84,59 @@ func (enc *Encode) Provision(ctx caddy.Context) error {
84
85
if enc.Matcher == nil {
86
// 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
88
+ // with application/atom+rss added
89
enc.Matcher = &caddyhttp.ResponseMatcher{
90
Headers: http.Header{
91
"Content-Type": []string{
90
- "text/*",
91
- "application/json*",
92
- "application/javascript*",
93
- "application/xhtml+xml*",
92
"application/atom+xml*",
93
+ "application/eot*",
94
+ "application/font*",
95
+ "application/font-sfnt*",
96
+ "application/font-woff*",
97
+ "application/geo+json*",
98
+ "application/graphql+json*",
99
+ "application/javascript*",
100
+ "application/javascript-binast*",
101
+ "application/json*",
102
+ "application/ld+json*",
103
+ "application/manifest+json*",
104
+ "application/opentype*",
105
+ "application/otf*",
106
"application/rss+xml*",
107
+ "application/truetype*",
108
+ "application/ttf*",
109
+ "application/vnd.api+json*",
110
+ "application/vnd.ms-fontobject*",
111
"application/wasm*",
112
+ "application/x-httpd-cgi*",
113
+ "application/x-javascript*",
114
+ "application/x-opentype*",
115
+ "application/x-otf*",
116
+ "application/x-perl*",
117
+ "application/x-protobuf*",
118
+ "application/x-ttf*",
119
+ "application/xhtml+xml*",
120
+ "application/xml*",
121
+ "font/otf*",
122
+ "font/ttf*",
123
+ "font/x-woff*",
124
"image/svg+xml*",
125
+ "image/vnd.microsoft.icon*",
126
+ "image/x-icon*",
127
+ "multipart/bag*",
128
+ "multipart/mixed*",
129
+ "text/css*",
130
+ "text/javascript*",
131
+ "text/js*",
132
+ "text/plain*",
133
+ "text/richtext*",
134
+ "text/x-component*",
135
+ "text/x-java-source*",
136
+ "text/x-markdown*",
137
+ "text/x-script*",
138
+ "text/xml*",
139
+ "text/html*",
140
},
141
},
142
}