Features Pricing Reviews FAQ
Get Plugin

GZIP Compression

4 min read

GZIP compression makes your pages smaller before they travel to the visitor’s browser. This guide shows you how to turn it on and what to do on different server types.

What this does

When GZIP is on, your server compresses text responses (HTML, CSS, JavaScript, and similar files) before sending them. The browser then unpacks them on the other end. Smaller transfers mean faster page loads, especially on slower connections.

xSpeed Cache has one toggle for this: Enable GZIP Compression.

On Apache and LiteSpeed servers, xSpeed Cache writes the needed rules for you automatically. On nginx, IIS, or any server xSpeed Cache cannot configure on its own, the toggle still saves your choice, but you add the server rules by hand using a snippet xSpeed Cache gives you.

Why use it

  • Text files transfer faster because they are smaller.
  • Pages feel quicker for visitors on slow or mobile connections.
  • It applies to your whole site, not just one page.

How to enable it

  1. Go to the xSpeed Cache dashboard in your WordPress admin.
  2. Open the GZIP panel.
  3. Switch on Enable GZIP Compression.

What happens next depends on your server.

On Apache or LiteSpeed

xSpeed Cache writes its compression rules into the .htaccess file in your site root automatically. The rules sit inside a marked block (# BEGIN xSpeed GZIP) and use Apache’s mod_deflate. There is nothing more for you to do.

Note: This needs a writable .htaccess file in your site root and mod_deflate available on the server. If either is missing, the rules will not take effect.

On nginx, IIS, or unknown servers

xSpeed Cache cannot edit these server configs for you. When you enable the toggle and GZIP is not detected on the response, the panel shows a warning with the directives to add.

For nginx, the GZIP directives are included in the unified server-block snippet shown on the Cache panel. Copy that snippet once into your nginx vhost (or your container’s nginx config) and reload nginx.

For IIS or unknown servers, the panel shows a snippet directly. Paste it into your server config and reload.

Settings explained

SettingWhat it doesDefault
Enable GZIP CompressionTurns GZIP on. Writes .htaccess rules automatically on Apache / LiteSpeed; shows a manual snippet on other serversOff (false)

Enable GZIP Compression. This is the only setting in the panel. On Apache and LiteSpeed, turning it on writes the rules for you and turning it off removes them. On other servers, it stores your preference and surfaces the snippet you need to add yourself. The default is off.

How xSpeed Cache checks if GZIP is working

After you enable the toggle, xSpeed Cache makes a request to your home page and looks at the response to see whether it is actually GZIP-encoded. The result is cached for about an hour to keep the check cheap.

  • If GZIP is detected, no warning shows.
  • If GZIP is enabled but not detected, the panel shows a warning that matches your server type, so you know what to fix.

Double-compression detection

GZIP only helps when it is applied once. If two layers both try to compress the same response, you can end up with a broken or doubly compressed page.

xSpeed Cache’s check looks at the live response from your home page. Because it reads what the browser would actually receive, it can tell you when GZIP is not being served as expected. On Apache or LiteSpeed, the most common cause of a failed check is another caching plugin overriding the rules, AllowOverride being disabled, or mod_deflate missing.

Tip: Run GZIP in only one place. If your host, a CDN, or another plugin already compresses responses, you do not need xSpeed Cache to add a second layer.

Troubleshooting

  • GZIP enabled but not active on the server (Apache / LiteSpeed). xSpeed Cache wrote the .htaccess rules but the response still is not gzipped. Your server may have AllowOverride disabled, another caching plugin overriding the rules, or mod_deflate missing. Ask your host to enable GZIP on Apache.
  • GZIP requires server config on nginx. xSpeed Cache cannot auto-configure nginx. Copy the unified server-block snippet from the Cache panel into your nginx vhost and reload nginx.
  • GZIP requires server config on this server (IIS / unknown). Paste the snippet shown in the panel into your server config and reload.
  • The warning will not go away after I added the snippet. The check result is cached for about an hour. Make sure you reloaded the server, then re-check after the cache clears.

FAQ

Does GZIP work on every server? The benefit works on any server, but only Apache and LiteSpeed are configured automatically. On nginx, IIS, or unknown servers you add the snippet by hand.

What does xSpeed Cache write to .htaccess? On Apache and LiteSpeed it adds a mod_deflate block inside a marked section so it can be cleanly added or removed when you toggle the setting.

Will it compress images? The rules target text-based responses such as HTML, CSS, JavaScript, XML, JSON, SVG, and web fonts. Already-compressed image formats are not re-compressed.

  • How to Enable Page Cache
  • Browser Cache Settings