Compressing Responses with Gzip and Brotli
Compression shrinks the text-based files your server sends — HTML, CSS and JavaScript — before they travel across the internet, then the browser unpacks them on arrival. It is one of the easiest and most effective speed improvements available.
Gzip and Brotli are the two common methods. Brotli is newer and usually compresses a little better.
A Simple, Universal Saving
Compression appeals because it asks so little and gives so much. It is enabled once at the server or CDN, needs no change to your content or design, and then quietly shrinks almost every text-based file your visitors download, on every page, from then on.
Why It Is Worth Doing First
Compression is often the single best return on effort in performance work. It is usually a configuration change, applies across the whole site at once, and costs nothing in design or development time.
- It is typically a one-time server or CDN setting.
- It benefits every text-based file at once.
- It needs no change to your design or content.
- The download savings are immediate and large.
How We Enable It
Compression is usually a server or CDN setting rather than a change to your site, which makes it one of the best returns on effort available. We confirm it is switched on and applied to the right files.
- Enable Brotli with a Gzip fallback on the server or CDN.
- Apply it to text-based files such as HTML, CSS and JavaScript.
- Skip already-compressed files like JPEGs to avoid wasted effort.
- Verify in the browser that responses arrive compressed.
Why It Works So Well
Code and markup are highly repetitive, so they compress dramatically — often by 70% or more. Smaller transfers mean faster downloads, especially on mobile connections.
Gzip vs Brotli
- Gzip is universally supported and very fast.
- Brotli typically produces smaller files for the same content.
- We enable Brotli with a Gzip fallback for full coverage.
| File type | Compresses well? |
|---|---|
| HTML / CSS / JS | Yes, dramatically |
| JSON / SVG | Yes |
| JPEG / PNG / WebP | No, already compressed |
If you need a hand with any of this, your Progressive Robot delivery team is ready to help. Raise a ticket from the Support area of your client portal or speak to your account manager and we will guide you through the next steps.