Enter any web address to see whether the server compresses it. The checker downloads the page four times, asking for no compression, GZIP, Brotli and Zstandard, and measures the bytes that actually travel over the network each time. It then checks the page’s CSS and JavaScript files too.
Why compression matters
HTML, CSS and JavaScript are plain text, and text compresses extremely well. A 100 KB page usually travels as 15 to 25 KB once compressed. That means faster first loads, especially on mobile connections, lower bandwidth bills, and better Core Web Vitals scores. The browser decompresses it instantly; visitors never notice anything except speed.
| Method | Header value | Typical saving on HTML | Browser support |
|---|---|---|---|
| GZIP | gzip | 70 to 80% | Every browser |
| Brotli | br | 75 to 85%, about 15 to 20% smaller than GZIP | Every current browser, over HTTPS |
| Zstandard | zstd | Similar to Brotli, faster to compress | Chrome, Edge and Firefox |
Images, video, PDFs and fonts in WOFF2 format are already compressed, so servers should not compress them again. The checker tells you when an address is one of those.
How to read the results
- Uncompressed is the page’s real size.
- Each method shows the size sent when the browser asks for it, and the saving. Not supported means the server ignored the request and sent the full size.
- The CSS and JavaScript files table shows how each file was sent to a modern browser. Any text file over 1 KB marked None is a quick win.
- Vary: Accept-Encoding should be present on compressed responses, so caches and CDNs keep the compressed and uncompressed copies apart.
Turn it on
Nginx
Add this inside the http block of /etc/nginx/nginx.conf, or in a file in /etc/nginx/conf.d/:
gzip on;
gzip_vary on;
gzip_proxied any;
gzip_comp_level 5;
gzip_min_length 256;
gzip_types text/css text/plain text/xml application/xml application/javascript application/json image/svg+xml;
Nginx always compresses text/html, so it is not listed. For Brotli, install the module (sudo apt install libnginx-mod-http-brotli-filter on Debian and Ubuntu, sudo dnf install nginx-mod-brotli on AlmaLinux and Rocky with EPEL), then add:
brotli on;
brotli_comp_level 5;
brotli_types text/css text/plain text/xml application/xml application/javascript application/json image/svg+xml;
Test and reload with sudo nginx -t && sudo systemctl reload nginx. New to Nginx? See how to install Nginx on Ubuntu.
Apache
Enable the modules with sudo a2enmod deflate brotli on Debian and Ubuntu (they are usually loaded already on AlmaLinux), then add to the site configuration or .htaccess:
<IfModule mod_brotli.c>
AddOutputFilterByType BROTLI_COMPRESS text/html text/css text/plain text/xml application/javascript application/json image/svg+xml
</IfModule>
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/css text/plain text/xml application/javascript application/json image/svg+xml
</IfModule>
Restart with sudo systemctl restart apache2 (Ubuntu) or sudo systemctl restart httpd (AlmaLinux).
LiteSpeed and cPanel hosting
In the LiteSpeed WebAdmin console, open Server Configuration » Tuning and turn on GZIP and Brotli compression. On shared cPanel hosting without server access, use Optimize Website in cPanel and choose Compress all content. See how to use cPanel.
Cloudflare and other CDNs
Cloudflare compresses text with Brotli or GZIP automatically when it proxies your site. If the checker shows no compression through Cloudflare, check Rules » Compression Rules, and make sure your server does not send Cache-Control: no-transform. See what a CDN is.
WordPress
Compression is the web server’s job, not WordPress’s. Caching plugins can add the Apache rules above to .htaccess for you, but on Nginx they cannot; add the Nginx settings instead.
Questions people ask
Should I use GZIP or Brotli?
Both. Turn on Brotli for browsers that support it and keep GZIP as the fallback. The server picks the best one the browser asks for, automatically.
Does compression use a lot of server CPU?
At the levels above, very little. Level 5 or 6 gives almost all of the saving; the highest levels cost much more CPU for a percent or two. Pages served from a cache are compressed quickly on each request.
Why does my page show compression but my CSS does not?
Often the gzip_types or AddOutputFilterByType list does not include text/css or application/javascript, or the files come from another server or CDN with its own settings. Add the missing types and test again.
Is it safe to compress pages over HTTPS?
Yes, for normal websites. The BREACH attack only matters for pages that reflect user input next to secret tokens in the same response, and frameworks protect against it with per-request tokens.
Related
Not sure where to turn it on? If your host will not enable compression, or you are not sure what is serving your site, we can look at it for you.
