How to enable text compression (Brotli, gzip)
HTML, CSS and JavaScript shrink by 70-90 % when compressed. It is one server setting and it is usually already available.
Step by step, with screenshots: Brotli compression: gzip vs Brotli and how to enable it →
Check your own site
Runs this check and the other 192, free, in about 45 seconds.
Or run only this check with the free Web hosting speed test.
What it is
Text compression means the server compresses HTML, CSS, JavaScript, JSON and SVG files before sending them, and the browser unpacks them on arrival. The two common methods are gzip and Brotli, and every modern browser supports both.
Text files typically shrink by 70-90 %, so a 300 KB JavaScript bundle can travel as 60 KB or less. getReport flags text responses sent without compression and shows the bytes you would save. A page is OK when every text response carries a Content-Encoding header of br or gzip; JPEG, PNG, WebP and video files and WOFF2 fonts are already compressed and do not need it.
What a passing site looks like
- Text files are compressedwarning · −4 ptseffort S
Text compression
Why it matters. HTML, CSS and JavaScript shrink by 70-90 % with Brotli or gzip. Without it every visitor downloads several times more than needed.
- Turn on Brotli or gzip on the server or CDN (Cloudflare does it automatically; Apache mod_deflate/brotli; nginx gzip on).
- Check that your CDN or plugin is not serving already-compressed assets without the Content-Encoding header.
Questions people ask
What does "Enable text compression" mean in Lighthouse?
It means some text files on the page, such as HTML, CSS, JavaScript or JSON, were sent without gzip or Brotli compression. Lighthouse lists each file with the bytes compression would save, and only flags files where it would save at least 1.4 KB and 10 %. Turning compression on at your server or CDN fixes it for every file at once.
How do I enable gzip compression in WordPress?
Compression is a server setting, so first check whether your host already enables it; most do. If not, caching plugins such as WP Rocket, W3 Total Cache or LiteSpeed Cache can add the rules on Apache and LiteSpeed servers. On nginx hosting, ask the host to enable gzip or Brotli. A CDN such as Cloudflare compresses responses for you.
How do I check if gzip compression is enabled?
Run a report: getReport lists any text files served without compression. To check a single file, open the Network panel in Chrome DevTools, select the request and look for content-encoding: gzip or br under Response Headers. From a terminal, curl -sI -H "Accept-Encoding: br, gzip" followed by the URL shows the same header.
Which files should not be compressed?
Files that are already compressed: JPEG, PNG, WebP and AVIF images, video, audio, WOFF2 fonts and zip archives. Compressing them again costs server time, saves nothing and can even make them slightly larger. Compress HTML, CSS, JavaScript, JSON, XML and SVG, plus older font formats such as TTF and EOT, which are not compressed inside.