Guide 5 min read

Enable Server-Side Compression

How to enable Gzip and Brotli compression on your server. Includes instructions for Apache, Nginx, and WordPress.

Uncompressed files slow your website down. When your crawler tool or PageSpeed audit flags the error “No Compression,” you are leaving performance — and rankings — on the table.

This guide shows you how to set up server-side compression correctly and achieve measurable load time improvements.


Why Compression Is a Ranking Factor

Google treats page load speed as a direct ranking factor — for both desktop and mobile. Uncompressed HTML, CSS, and JavaScript files cost load time every time a user visits your page.

The Impact on User Experience and Bounce Rate

Every second of delay significantly increases the bounce rate. Studies show:

  • 1–3 seconds load time: bounce rate increases by 32%
  • 1–5 seconds: bounce rate increases by 90%
  • 1–10 seconds: bounce rate increases by 123%

Compression reduces the transferred data volume by 70–90%. That means faster load times, better Core Web Vitals — and fewer lost visitors.

Which File Types Benefit from Compression

Not all files compress equally well:

File TypeCompression UsefulTypical SavingsHTMLYes70–85%CSSYes75–90%JavaScriptYes70–85%SVGYes60–80%JSON/XMLYes80–90%JPEG/PNGNoAlready compressedMP4/WebMNoAlready compressedWOFF/WOFF2NoAlready compressed

Text-based formats benefit most. Images and videos are already compressed — additional compression provides no advantage.


How to Check Whether Compression Is Active

Before making changes, determine the current status.

Check via Browser DevTools

Open your browser’s developer tools (F12) and switch to the “Network” tab:

  • Reload your page
  • Click on an HTML, CSS, or JS file
  • Look under “Response Headers” for the “Content-Encoding” entry

If it reads “gzip” or “br” (Brotli), compression is active. If the header is missing, the file is being delivered uncompressed.

Automated Check with Online Tools

These tools check compression automatically:

  • Google PageSpeed Insights
  • GTmetrix
  • WebPageTest
  • Screaming Frog SEO Spider

You will receive a list of all uncompressed resources along with the potential savings in kilobytes.


Enable Compression on the Server

Compression is configured at the server level. The process differs depending on your setup.

Enable Gzip Compression for Apache

If your server runs Apache, edit the .htaccess file in your website’s root directory:

<IfModule mod_deflate.c>
  AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript
  AddOutputFilterByType DEFLATE application/javascript application/x-javascript
  AddOutputFilterByType DEFLATE application/xml application/xhtml+xml application/rss+xml
  AddOutputFilterByType DEFLATE image/svg+xml
</IfModule>

This code enables Gzip for all relevant file types. Re-check via DevTools after implementation.

Enable Gzip Compression for Nginx

For Nginx, edit the configuration file (usually /etc/nginx/nginx.conf):

gzip on;
gzip_vary on;
gzip_min_length 1024;
gzip_types text/plain text/css text/xml text/javascript application/javascript application/xml+rss application/json image/svg+xml;
gzip_disable "MSIE [1-6]\.";

After the change, reload Nginx:

sudo systemctl reload nginx

Brotli as an Alternative to Gzip

Brotli is a newer compression algorithm with up to 20% better compression rates than Gzip. Modern browsers fully support Brotli.

For Apache:

<IfModule mod_brotli.c>
  AddOutputFilterByType BROTLI_COMPRESS text/html text/plain text/css application/javascript
</IfModule>

For Nginx:

brotli on;
brotli_types text/plain text/css application/javascript application/json image/svg+xml;

Ideally, enable both Gzip and Brotli in parallel. The server then delivers the optimal variant based on what the browser supports.


Compression for WordPress Websites

WordPress users can enable compression without direct server access.

Enable Compression via Plugins

These plugins activate Gzip automatically:

  • WP Rocket (premium, comprehensive performance optimization)
  • W3 Total Cache (free, advanced caching options)
  • LiteSpeed Cache (free, optimized for LiteSpeed servers)
  • Autoptimize (free, combines compression with minification)

After installation, enable the “Gzip Compression” option in the plugin settings.

Manual Activation via .htaccess

If you prefer to avoid plugins, add the Apache code from the section above directly to the .htaccess file. You will find it in the root directory of your WordPress installation.


Common Mistakes During Implementation[h2/]

Even with correct configuration, issues can arise.

Avoid Double Compression

If both the server and a CDN apply compression, errors can occur. Check:

  • Is compression enabled in the CDN? (e.g., Cloudflare, KeyCDN)
  • Is it simultaneously active at the server level?
  • Are files being compressed twice?

Disable compression at either the server or CDN level — not both simultaneously.

Missing Server Modules

Gzip and Brotli require specific Apache or Nginx modules:

ServerGzip ModuleBrotli ModuleApachemod\_deflatemod\_brotliNginxngx\_http\_gzip\_modulengx\_brotli

If the modules are missing, contact your hosting provider. Most managed hosting providers have them pre-installed.

Cache Issues After Activation

After enabling compression, you may not see an immediate change. Clear:

  • Browser cache (Ctrl + Shift + Delete)
  • Server cache (via plugin or hosting panel)
  • CDN cache (via CDN dashboard)

Only after that will compressed files be delivered.


Measuring Results and Performance Monitoring

After implementation, measure the impact.

Before-and-After Comparison

Use Google PageSpeed Insights or GTmetrix to compare these metrics:

  • Total transferred data size
  • Load time (Time to Interactive)
  • First Contentful Paint (FCP)
  • Largest Contentful Paint (LCP)

Correctly implemented compression reduces data volume by 70–90% and improves LCP by 0.5–2 seconds.

Long-Term Monitoring

Set up regular checks:

  • Monthly PageSpeed audits
  • Automated monitoring tools (e.g., Google Search Console, Uptime Robot)
  • Crawler-based checks (Screaming Frog, OnCrawl)

This ensures compression stays active after updates or server migrations.


Further Optimizations

Compression is an important step — but not the only one.

Combine with Minification

Remove unnecessary characters from code:

  • Strip whitespace, line breaks, and comments
  • Minify CSS and JS files
  • Reduce HTML whitespace

Tools like Autoptimize or WP Rocket handle this automatically.

Use HTTP/2 or HTTP/3

Newer protocols transfer data more efficiently:

  • HTTP/2: Multiplexing, header compression
  • HTTP/3: QUIC protocol, even faster on poor connections

Check with your hosting provider whether HTTP/2 or HTTP/3 is available. Most modern hosting providers support at least HTTP/2.

Lazy Loading for Images and Videos

Compression speeds up text resources. For media, use lazy loading:

  • Images load only when scrolled into view
  • Videos do not autoplay
  • Significantly reduces initial load time

WordPress has supported lazy loading natively since version 5.5. For older versions, use plugins like a3 Lazy Load.


Conclusion: Compression as a Performance Foundation

The on-page error “No Compression” is straightforward to fix — and the impact on load time and rankings is measurable.

Enable Gzip or Brotli at the server level, verify implementation via DevTools, and monitor results continuously. Combine compression with minification, caching, and modern protocols for maximum performance.

Your website will be faster. Your users will stay longer. Google will rank you higher.

Need help with the implementation?

As an SEO freelancer with over 20 years of experience, I help you implement technical SEO professionally — fair, direct, and without long-term contracts.

Christian Synoradzki

Über den Autor

Christian Synoradzki

SEO-Freelancer

Mehr als 20 Jahre Erfahrung im digitalen Marketing. Fairer Stundensatz, keine Vertragsbindung, direkter Ansprechpartner.