CloudFlare not serving pre-compressed Brotli from the origin

What is the name of the domain?

https://irr.8credits.com/

What is the issue you’re encountering

Cloudflare does not serving pre-compressed Brotli from the origin. Instead, it serves CF zstd-compressed version of the file.

What steps have you taken to resolve the issue?

I made sure that I followed this page: Content compression | Brotli

The brotli compression used to work properly, but stopped working when I checked today.

A direct connection to the origin shows that a heavily-compressed brotli file is served from the origin.

@hong5 - Sorry this is due to Free plans and a Zstd compression test we are running.

I have given you 5 Compression Rules - we will be backfilling all plans to have Compression rules soon and improving the simplicity to deploy a rule like below – however.

Filter – this is our default of what we compress:

(http.response.content_type.media_type in {"text/html" "text/richtext" "text/plain" "text/css" "text/x-script" "text/x-component" "text/x-java-source" "text/x-markdown" "application/javascript" "application/x-javascript" "text/javascript" "text/js" "image/x-icon" "image/vnd.microsoft.icon" "application/x-perl" "application/x-httpd-cgi" "text/xml" "application/xml" "application/rss+xml" "application/vnd.api+json" "application/x-protobuf" "application/json" "multipart/bag" "multipart/mixed" "application/xhtml+xml" "font/ttf" "font/otf" "font/x-woff" "image/svg+xml" "application/vnd.ms-fontobject" "application/ttf" "application/x-ttf" "application/otf" "application/x-otf" "application/truetype" "application/opentype" "application/x-opentype" "application/font-woff" "application/eot" "application/font" "application/font-sfnt" "application/wasm" "application/javascript-binast" "application/manifest+json" "application/ld+json" "application/graphql+json" "application/geo+json"})

Choose custom and put Brotli and Gzip

This should fix the issue.

Matt

@hong5 Actually I was incorrect.

We would have been decompressing and recompressing in Brotli (at a lower rate) you have the following enabled – This needs to be disabled this should fix your issue.

This was a release for fixing a Polyfill vuln but requires decompression. Disabling this will mean consistent compression will work, and you DO NOT need a compression rule.

1 Like

Thanks, this works! I’ve opened a PR to fix the doc Add "Replace insecure JS library" to brotli-compression-warning.mdx by xuhdev · Pull Request #16402 · cloudflare/cloudflare-docs · GitHub

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.