Closed jsheard closed 22 hours ago
Hmm, we used to do that: https://github.com/caddyserver/caddy/commit/d3f23a8eeb3b0b7198ae4c06879227b467fcfaa6
@dunglas what do you think?
I agree. We should exclude these ones.
I believe the formats supported by browsers pre-WOFF were TTF, OTF, EOT and SVG, with these MIME types:
font/ttf
font/otf
application/vnd.ms-fontobject (EOT)
image/svg+xml (SVG fonts don't appear to have a more specific MIME type)
Caddy already has specific matchers for EOT and SVG so I think it would only need font/ttf
and font/otf
to be added in lieu of font/*
.
I opened https://github.com/caddyserver/caddy/pull/6432 to fix the issue. Would you mind double-checking the patch @jsheard?
The default matcher for
encode
currently includesfont/*
, matching every font format. However, the modern WOFF and WOFF2 web font formats are already internally compressed with zlib and brotli respectively, so compressing them again is likely a waste of CPU cycles. Would it make sense to refine the defaults down to only compress the "legacy" non-WOFF formats?https://www.iana.org/assignments/media-types/media-types.xhtml#font