Performance

How to fix: Response compression (gzip / Brotli)

Compression shrinks text-based responses (HTML, CSS, JavaScript, JSON) before they're sent, so pages download faster.

Not sure whether your site has this problem? Check it in seconds.

Why it matters

Smaller responses mean less data over the network, which helps most on slow connections. Already-compressed files such as JPEG, PNG, WebP and video shouldn't be compressed again.

How to check

In DevTools → Network, click the main document and look for Content-Encoding: gzip or br in the response headers.

How to fix it

Nginx (gzip)

gzip on;
gzip_comp_level 5;
gzip_min_length 256;
gzip_vary on;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml image/svg+xml;

Apache

AddOutputFilterByType DEFLATE text/html text/plain text/css application/json application/javascript text/xml application/xml image/svg+xml

Common mistakes

Frequently asked questions

Brotli or gzip?

Brotli usually compresses smaller; gzip is universally supported. Serving Brotli with a gzip fallback is common.

Related guides

Guidance is general. Test header and DNS changes on a staging copy first, and check your hosting provider's documentation for platform-specific steps.