All tools · Performance

Compression & HTTP/2 Checker

Check whether your HTML is served with Brotli or gzip, whether the server speaks HTTP/2 or HTTP/3, and how fast the first byte arrives.

This is one of our 170+ checks.

Run the full audit: performance, security, SEO and AI readiness in one report, free and without sign-up.

Run the full audit →

What the Compression & HTTP/2 Checker checks

Text compression shrinks HTML, CSS and JavaScript before they travel over the network; the browser decompresses them on arrival. Brotli and gzip are the two encodings every modern browser supports. The HTTP version decides how efficiently many files share one connection: HTTP/2 multiplexes requests over a single connection, and HTTP/3 does the same over QUIC, which handles packet loss better on mobile networks.

This checker requests the URL you enter with a browser-like Accept-Encoding header and reports the Content-Encoding the server returns for the HTML, the HTTP version it supports (including HTTP/3 advertised through the alt-svc header) and the time to first byte. It checks the HTML document itself, not every asset on the page.

Why it matters

HTML, CSS and JavaScript compress very well, so serving them uncompressed wastes bandwidth and delays rendering, especially on slow connections. Compression is usually one setting, which makes it one of the cheapest performance fixes available.

Time to first byte is the wait before anything can render. Google’s guidance treats a TTFB of 0.8 seconds or less as good. A slow TTFB pushes back every other metric, including Largest Contentful Paint, so it is worth fixing before tuning the front end. See time to first byte.

How to fix common problems

Enable compression for text types. In nginx: gzip on; gzip_types text/css application/javascript application/json image/svg+xml; (HTML is compressed by default), and add Brotli with the ngx_brotli module. In Apache, enable mod_deflate and mod_brotli. Most CDNs, including Cloudflare, compress automatically when the origin does not. Do not compress already-compressed formats such as JPEG, PNG, WebP or WOFF2. Our text compression guide has more examples.

For HTTP/2, add http2 to the TLS listener (listen 443 ssl; http2 on; in recent nginx). HTTP/2 requires HTTPS in browsers. HTTP/3 needs UDP port 443 open; the simplest route is a CDN or a server with built-in support such as Caddy. See HTTP/2 and HTTP/3.

To lower TTFB, cache rendered pages (full-page cache or CDN caching for anonymous visitors), speed up slow database queries and place content close to users. The full PerfoMetrix audit adds Lighthouse lab metrics and real-user data to these results, among 170+ checks.

Questions

Brotli or gzip: which is better?

Brotli typically produces smaller files for text and all modern browsers support it over HTTPS. Keep gzip enabled as a fallback for clients that do not send br in Accept-Encoding.

Why is my TTFB different from Lighthouse?

TTFB depends on where the request comes from, whether caches are warm and current server load. Single measurements vary; compare several runs or real-user data.

Does HTTP/3 replace HTTP/2?

Browsers use HTTP/3 when the server advertises it and the network allows UDP, and fall back to HTTP/2 otherwise. Supporting both is normal.