Cloudflare and brotli compression

I have a specific API which checks for the “Accept-Encoding” header from the frontend and will send a BR/Gzip compressed payload accordingly - the server also sets an Etag in the response

Im having trouble getting cloudflare to work with this. Ideally, i would like cloudflare not just forward across the request to my backend and not manage cache etc

to this effect, i added the page rules : Cache-level: Bypass and disable performance

with the above rules , i can see that cloudflare is successfully proxying the eTag back to the browser and uses Gzipped content.

However , CF seems to be only forwarding 'Accept-encoding: gzip` to my bakcned when my browser can accept Brotli as well.

I tried enabling brotli compression in cloudflare - but the Etag is no longer being set in the browser.

Is there a way i can have cloudflare send forward the full Encoding headers and also have it set the Etag properly in the browser

CF CDN edge servers only support gzip communication to origin servers so brotli I believe just requests uncompressed asset and brotli conversion is done on CF edge servers.

It’s probably done this way as CF CDN cache doesn’t support HTTP vary header Cloudflare CDN Cache To Support HTTP Vary Header so wouldn’t be able to differentiate between a browser that supports brotli vs gzip at origin level (only at CF Edge server)