What is gzip?
gzip (GNU zip) is a widely used compression program and file format that is applied above all on the web to reduce the file size of web content such as HTML, CSS and JavaScript files. Developed by Jean-loup Gailly and Mark Adler in 1992, it has become the standard for file compression on the internet.

gzip uses the DEFLATE algorithm, a combination of the LZ77 algorithm and Huffman coding, to compress data efficiently. Thanks to gzip compression, web servers can send content to the browser in a smaller format, which shortens the loading times of a page significantly, because less data has to travel across the internet.
How do I enable gzip on my website?
How you enable gzip depends on the web server you use. For the two most common web servers, Apache and Nginx, there are specific configurations.
Apache: with Apache, gzip is enabled through the module mod_deflate. This module lets the server compress content before it is sent. To switch it on, edit the .htaccess file of your website or the main configuration file of the Apache server and add the following code:
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
</IfModule>
Nginx: with Nginx, gzip is switched on in the configuration file nginx.conf. Add the following directives to the file to enable gzip:
gzip on;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
With these configurations in place, the server compresses the file types listed automatically before they go out to the browser.
Is gzip outdated?
Although gzip has been around for more than three decades, it is not outdated. It remains an efficient and widely used way to reduce the size of web content. Modern alternatives such as Brotli, which was developed by Google, offer a better compression ratio than gzip and are supported by more and more modern browsers. Brotli is particularly effective at compressing text files and can improve loading times further. Even so, not every browser and not every web server supports Brotli, which makes gzip a reliable and compatible choice for website optimization. In practice it is recommended to support both compression methods, so that you get the best possible performance and compatibility.
Is using gzip an important SEO strategy?
Using gzip is an important part of search engine optimization. The reason is that the speed of a website is a critical factor for ranking in search engines like Google, which put a number on it with the Core Web Vitals. Websites that load faster offer a better user experience, and that is a key element of a positive assessment by search engines. gzip contributes considerably to shorter loading times, because it compresses the size of the files that travel across the internet.
On top of that, search engines like Google value the mobile friendliness of websites. Mobile visitors often work with limited data plans or slower connections, so cutting file sizes with gzip is especially valuable to keep loading times short on mobile devices as well.
Whether compression is active on your server, and which files still travel uncompressed, is one of the points we check in an SEO audit.
Welt der SEO lernen?