What it does
Compression reduces transfer size for text responses. A compression checker requests the same URL with different Accept-Encoding values and compares the bytes, so you can see whether Brotli or gzip is applied, whether the server honours negotiation, and how much is actually saved.
How it works
The client sends Accept-Encoding: br, gzip, or identity and reads Content-Encoding on the response. A correct server picks the best supported encoding and varies the response accordingly.
Brotli usually beats gzip on text, but the gain depends on the content and the compression level. Highly dynamic HTML compressed on the fly may use a lower level than static assets precompressed at build time.
The Vary header matters. If a response is compressed for one client and cached, others may receive a body they cannot decode. Vary: Accept-Encoding tells caches to key on the header.
Some content should not be compressed. JPEG, PNG, WebP and most video are already compressed; re-compressing wastes CPU and can enlarge the result. Servers should skip those types, and double compression must be avoided.
Compression and secrets need care. Compressing responses that mix attacker-controlled input with secrets can enable BREACH-style attacks. Disable compression on sensitive endpoints or add per-response randomness.
When to use it
- Confirm Brotli is enabled for HTML and static assets.
- Measure the real transfer size difference between encodings.
- Detect a CDN that strips or overrides Content-Encoding.
- Check that already-compressed images are not being re-compressed.
Glossary
- Accept-Encoding
- The request header listing compression formats the client supports.
- Content-Encoding
- The response header naming the compression actually applied.
- Brotli
- A compression format with a dictionary tuned for web content.
- Vary
- A header telling caches which request headers change the response.
- BREACH
- An attack that exploits compression to infer secrets from response sizes.
Frequently asked questions
Why is gzip served even though I sent br?+
The server or CDN may not have Brotli enabled, may only use it for static assets, or may have negotiated a lower preference. Check the response's Content-Encoding and the CDN configuration.
Does compression help HTTPS?+
Yes. TLS encrypts but does not compress, so transfer size still matters. Compression is applied before encryption.
Why is a compressed response larger than the original?+
Small or already-compressed bodies can grow. Servers should skip compression below a size threshold and for image formats.
Is Brotli always better?+
Not always. It has higher CPU cost and can be slower for small dynamic responses. Compare actual bytes and latency for your workload.
What does Vary: Accept-Encoding prevent?+
A cache serving a Brotli body to a client that only understands gzip, or vice versa. Without it, shared caches can mix incompatible responses.
API & MCP
The same result envelope is available over REST and MCP. Replace the sample value with your own target.
curl "https://100www.dev/api/v1/tools/compression-checker?u=https%3A%2F%2Fwww.cloudflare.com"Shareable result
https://100www.dev/tools/compression-checker?u=https%3A%2F%2Fwww.cloudflare.com

100www engineering
EditorialReviewed by Steve · · Report an error
Tested from the 100www probe network; results vary by location and network.


