For Preact’s Docs site, we distribute the page content largely by markdown (*.md). However, it’s come to my attention that this is not being compressed by Netlify and there’s no obvious way to configure this. Compression for markdown is an absolute no-brainer, with 10kb+ savings on some of the larger pages.
So assuming the netlify.app URL is correct then it is not Netlify that is stopping the serving of brotli but Cloudflare which preactjs.com is proxied through. If you haven’t read it before, check out
Hm, indeed! Didn’t realize there was a netlify.app URL.
Unfortunately that linked post is a bit tone deaf when it comes to the necessity of Cloudflare and dropping it is definitely off the table. Will have to figure out what’s causing compression to fail on CFs end then.
Found it, Cloudflare (for some reason) still only recognizes the text/x-markdown content type and Netlify serves text/markdown. Quick enough of a fix using a _headers file: