Brotli and Gzip: What modern websites really need
Brotli and Gzip compress text resources; the server selects based on browser support. Images and compressed formats usually do not benefit from further compression.
For web developers and website operators, the key aspects of "Using Brotli and Gzip Correctly" are "Appropriate Content Type" and "Clean Negotiation." The perspective "Resources, Compression, and Cache" demonstrates how these two points interact in practice.
Published: 3 min read · Author: Sebastian Geier
When should a modern website offer Brotli, Gzip, or both compression methods?
Modern websites offer Brotli for supported clients and Gzip as a broad fallback for suitable text content. The selection is made via Accept-Encoding; the cache and CDN must correctly distinguish between variants using Vary.
Test case: "Missing Vary header"
A CDN delivers JavaScript via Brotli but retains a Gzip variant for an older client. Images remain in their optimized format; a test with varying Accept-Encoding confirms that the cache does not incorrectly reuse any Brotli responses.
Clean negotiation
Representative text and binary resources are captured with their current encoding, type, and cache headers.
Servers or CDNs are assigned a unique priority for Brotli, Gzip, and uncompressed fallbacks for each content type.
Requests with different Accept Encoding values check content, headers, cache matches, and end-to-end decoding.
Appropriate content type
Test criterion
Appropriate content type
HTML, CSS, JavaScript, JSON, and other text formats are compressed; already compressed media is generally not compressed again.
Test criterion
Clean negotiation
Content encoding matches the request, and every delivered variant can be correctly decoded.
Cache Separation – Caches differentiate representations by accepted encoding and do not deliver an incorrect variant.
Cache Separation
Bytes transferred per text resource type and delivered content encoding.
Proportion of compressible responses without expected encoding or with an incorrect cache variant.
Missing Vary Header
Missing Vary Header – A cache can send a Brotli response to a client that did not request or support it.
Double Compression – Multiple or unnecessary compression consumes CPU and can increase response size instead of reducing it.
File Size Only A good compression ratio doesn't fix late discovery or resource blocking.
What to Check Before and After "Using Brotli and Gzip Correctly"
A suitable in-depth resource is available Improving LCP without damaging the visible design"How to Improve LCP Without Breaking the Visible Page Design?"
In addition: Cleanly separating CDN caching and browser caching.
If you want to put "Using Brotli and Gzip Correctly" into practice, you can go to Robust Website Systems Refer back to this. The focus there is on "Resources, Compression and Cache" and "Suitable Content Type."
Conclusion: Using Brotli and Gzip correctly
Brotli and Gzip complement each other as negotiated variants for text resources.
Sources and Further Information
These primary sources make the assumptions, system limitations, and testing methods for "Using Brotli and Gzip correctly" comprehensible.
RFC 9110: HTTP SemanticsThe HTTP standard defines content encodings, including gzip, and the negotiation of supported methods via Accept-Encoding.
RFC 7932: Brotli Compressed Data FormatThe IETF standard specifies the Brotli data format and ranks its compression performance against Deflate-based methods.
Key Thesis
The server negotiates the best supported encoding variant via Accept-Encoding and provides Gzip as a broad fallback. Suitable text types are compressed, while cache keys vary correctly.
What This Is Not About
Brotli and Gzip are not applied sequentially to the same response and do not replace suitable image or media formats.
What it's about
The server negotiates the best supported encoding variant for compressible text resources and provides a suitable fallback.
More insights
Core Web Vitals & Performance
Define cache runtimes based on file type and change risk.
As a separate test step for "Using Brotli and Gzip correctly," the question is: How do you determine cache runtimes based on file type and change risk?
Core Web Vitals & Performance
Prioritizing images instead of lazily loading everything
Supplements "Using Brotli and Gzip correctly" with a separate decision: Which images should a website prioritize and which should load with a delay?
Insights Overview
All VELUNO Insights at a Glance
Further analyses on Website Systems, digital visibility, and robust working models.
Clean negotiation: The path to testing
A header audit of a few representative resources uncovers most configuration errors. The origin and CDN are checked with several accepted encodings.