Skip to content

Text compression

Does the server transfer the page compressed so that it arrives faster?

What we check

We read from the response of the server whether the HTML of the home page is transferred compressed. Common methods are:

  • Brotli (br): the most modern and most efficient,
  • GZIP (gzip): the classic, available everywhere,
  • Zstandard (zstd): new, supported by current browsers.

If an HTML file over 1 KB is transferred uncompressed, there is a warning. In the report you see which method the server uses.

Why it matters

HTML, CSS and JavaScript are text files. Text compresses extremely well because many character sequences repeat. A page with 100 KB of HTML typically becomes only 20 to 30 KB when compressed, so around 70 % smaller.

The browser unpacks the data in fractions of a second. For visitors compression therefore means only advantages: less waiting time, especially on the move on the mobile network, and less data volume used.

If compression is missing, it is almost always an oversight in the server configuration. Modern hosting plans have it activated by default.

How to fix it

Hosting panel

With many hosting providers there is a setting such as "GZIP compression", "Brotli" or "Enable compression". If you do not find one, a short message to the support is usually enough.

Apache (.htaccess)

<IfModule mod_deflate.c>
  AddOutputFilterByType DEFLATE text/html text/plain text/css application/javascript application/json image/svg+xml
</IfModule>

nginx

gzip on;
gzip_types text/plain text/css application/javascript application/json image/svg+xml;

With nginx text/html is always included as soon as gzip on is set.

WordPress

Cache plugins such as WP Rocket, W3 Total Cache or LiteSpeed Cache switch compression on on request by writing the appropriate lines into the .htaccess.

CDN

If the website runs through a CDN such as Cloudflare, it takes over compression, also with Brotli. Check in the settings whether it is active.

Wix, Jimdo, Squarespace

The builders compress automatically. If a problem is reported here, it lies with the provider.

How to check it yourself

Open the developer tools (F12), "Network" tab, reload the page and click the HTML document. Under "Response headers" there should be content-encoding: br or content-encoding: gzip.

Frequently asked questions

Does compression put a load on the server?

Hardly. Modern servers compress very quickly, and many cache the compressed version. The gain in transfer is many times greater.

Should images be compressed this way too?

Not this way. Images such as JPEG, PNG or WebP are already compressed. The tips in the article on images apply to them.

Check a website now

We check "Text compression" and all other points in a few minutes, free and without sign-up.