Website & Technik1. April 2025 

Enable GZIP compression: Step-by-step guide

GZIP compression cuts the amount of data transferred by half for most websites—improving both load times and Core Web Vitals in one go. However, it isn’t enabled by many hosting providers. We’ll show you step by step how to enable GZIP via .htaccess or your hosting control panel and measure its impact.

Veröffentlicht
Lesedauer
min
Aktualität
aktuell
Enable GZIP compression: Step-by-step guide

TL;DR

  • GZIP compression cuts the amount of data transferred by most websites in half.
  • Better load times and Core Web Vitals in one step.
  • Can be enabled via .htaccess, a plugin, or your hosting panel.
  • Verify the effect using GTmetrix or PageSpeed Insights.

In a nutshell:

  • GZIP compression cuts the amount of data transferred by half for most websites—improving both load times and Core Web Vitals in one go.
  • However, it isn’t enabled by many hosting providers.
  • We’ll show you step by step how to enable GZIP via .htaccess or your hosting control panel and measure the results.

 

Want to make your website faster and drastically reduce load times? GZIP compression is the key. It reduces the size of HTML, CSS, and JavaScript files before they’re sent to the browser, saving bandwidth and improving the user experience.

Benefits at a glance:

  • Faster load times: Files are reduced in size by up to 80%.
  • Less bandwidth consumption: Ideal for text-based content.
  • SEO boost: Faster websites rank better.

How to enable GZIP:

  1. Via plugins (e.g., WP Rocket, W3 Total Cache for WordPress).
  2. Directly in the `.htaccess` file (add code).
  3. Server-side for TYPO3 (adjust settings in the backend).

Finally, use tools like GTmetrix or Google PageSpeed Insights to check if compression is active. Your website will become faster, more efficient, and more user-friendly—all in just a few steps!

Before you begin

Check server requirements

Make sure your server supports GZIP. Most modern web servers already have GZIP enabled:

Web server GZIP Support Required module
Apache Enabled by default mod_deflate
NGINX Enabled by default ngx_http_gzip_module
IIS Starting with version 7.5 HTTP Compression

To check for GZIP support:

  • Use phpinfo(): Create a temporary PHP file with phpinfo();to display the server information.
  • Check modules: Make sure the required modules are installed and enabled.
  • Use the hosting panel: Check the server settings directly in your hosting control panel.

Once the server requirements are met, you should back up your website to minimize potential risks.

Create a website backup

A full backup protects against data loss and configuration issues. Proceed as follows:

  • Back up files and the database:
    • Download all website files (including .htaccess) via FTP or the hosting panel.
    • Export the database using tools like phpMyAdmin.
    • Save the files and the SQL dump both locally and in the cloud.
  • Document the configuration:
    • Take screenshots of your hosting panel settings.
    • Create a copy of the current .htaccess file.
    • Make a note of all active plugins and their settings.

A carefully created backup makes restoration easier and gives you peace of mind when making changes.

GZIP Setup for WordPress

Enabling via Plugins

Here’s how you can easily enable GZIP compression using plugins:

WP Rocket

  1. Go to “Settings > WP Rocket”.
  2. Navigate to the “File Optimization” tab.
  3. Enable the “GZIP compression” option.
  4. Save the changes.

W3 Total Cache

  1. Open “Performance > General Settings”.
  2. Scroll to the "HTTP Compression" section.
  3. Enable the "GZIP compression" setting.
  4. Save the changes and clear the cache.

Enabling via the .htaccess file

If you prefer to work directly through the server configuration, you can enable GZIP via the .htaccessfile:

  1. Create a backup of
    the .htaccess file Download your current .htaccessfile via FTP or your hosting panel and save it as a backup.
  2. Add code to the .
    htaccess file Add the following code to the beginning of your .htaccess file:
    <ifmodule mod_deflate.c>
     AddOutputFilterByType DEFLATE text/html text/plain text/xml
     AddOutputFilterByType DEFLATE text/css text/javascript
     AddOutputFilterByType DEFLATE application/xml application/xhtml+xml
     AddOutputFilterByType DEFLATE application/javascript application/x-javascript
     AddOutputFilterByType DEFLATE application/json
    </ifmodule>
    
  3. Test functionality
    • Check to see if your website is working as usual.
    • Measure your page’s load times using tools like GTmetrix.
    • Watch for error messages or issues.

If errors occur, you can restore your .htaccessfile and use the plugin method instead.

Next, we’ll explain how to enable GZIP in TYPO3.

GZIP Setup for TYPO3

TYPO3

TYPO3 Settings

GZIP compression can be enabled directly in TYPO3 via the backend. Here’s how it works:

  • Extension Manager
    Open the Extension Manager in the TYPO3 backend and make sure the Frontend Performance extension is installed.
  • Adjust Settings
    Go to Admin Tools > Settings > Configure Installation-Wide Options. In the Frontend Performance section, enable the option enableContentCompression and set the value to 1.
  • Clear the cache
    Clear the cache using Clear all caches and check the frontend output to ensure the changes take effect.

Alternatively, you can also configure GZIP compression via the .htaccessfile.

TYPO3 .htaccess setup

  • Create a backup
    Back up your current .htaccessfile, which is located in the root directory of your TYPO3 installation.
  • Add GZIP configuration
    Add the following code to the .htaccessfile:
<ifmodule mod_deflate.c>
 SetOutputFilter DEFLATE

 # Komprimierung für TYPO3-Dateitypen
 AddOutputFilterByType DEFLATE text/html text/plain text/xml
 AddOutputFilterByType DEFLATE text/css text/javascript
 AddOutputFilterByType DEFLATE application/xml application/xhtml+xml
 AddOutputFilterByType DEFLATE application/javascript application/x-javascript
 AddOutputFilterByType DEFLATE application/json
 AddOutputFilterByType DEFLATE application/x-typo3-fluid

 # Browser-Anpassungen
 BrowserMatch ^Mozilla/4 gzip-only-text/html
 BrowserMatch ^Mozilla/4\.0[678] no-gzip
 BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
</ifmodule>
  • Test the configuration
    After making the change, check your website’s functionality. Use tools like GTmetrix or Google PageSpeed Insights to ensure that compression is active. Also monitor server load to detect potential issues early on.

Note: If your TYPO3 installation is located in a subdirectory, adjust the path in the .htaccessfile accordingly. Additionally, the Apache module mod_deflate must be active on your server.

 

how to enable gzip compression without a plugin and increase …

 

You are currently viewing placeholder content from YouTube. To access the actual content, click the button below. Please note that this will result in data being shared with third parties.

More information

Test GZIP setup

Once GZIP is set up, you should make sure it’s working correctly.

Tools for testing GZIP compression

There are various tools you can use to check if GZIP is working correctly:

  • GTmetrix: Analyzes the compression rate of each file and provides detailed performance data. Visit: gtmetrix.com.
  • Google PageSpeed Insights: Displays performance analyses for desktop and mobile, including a GZIP check.
  • GIDZipTest: A specialized tool that is particularly well-suited for checking GZIP configuration.

Interpreting Test Results Correctly

To optimize your website, you should thoroughly understand the test results:

  • Successful compression:
    • The original file size is displayed (e.g., 100 KB).
    • The compressed size is also shown (e.g., 25 KB).
    • A compression rate between 60% and 80% is considered ideal.
    • The HTTP header contains the entry “Content-Encoding: gzip”.
  • Failed compression:
    • Check the configuration of your .htaccessfile.
    • Make sure the server settings are correct (e.g., mod_deflate is enabled).
    • Check CMS-specific settings, such as in WordPress or TYPO3.

Troubleshooting tips

After every change, you should test the website in different browsers to identify any potential display issues. If the results aren’t as expected, adjust the settings and test again. This way, you can further optimize the configuration.

Conclusion

GZIP compression helps boost your website’s performance by reducing load times and improving the user experience.

Setup overview

Enabling GZIP depends on the system you’re using:

  • WordPress: Via a plugin or by making adjustments to the .htaccess file.
  • TYPO3: By making changes to the system settings or, similarly, in the .htaccess file.

GZIP can compress text files by about 60–80%. This significantly speeds up loading times. A faster website not only leads to more satisfied users but also positively impacts search engine rankings, as loading speed is a key factor for SEO.

After setup, you should check the GZIP status using appropriate tools. This allows you to quickly identify and fix any potential errors.

Use these tips to review your settings and make your website more efficient.