What Is GZIP?
GZIP is a compression algorithm and file format that has been a standard component of the web since the early 1990s. Its name is derived from "GNU zip", the original Unix utility. In web performance, GZIP compression refers to a server-side process where the web server compresses text-based files before sending them to the requesting browser. The browser decompresses the files near-instantly using built-in capabilities and renders the page as normal. The user experiences exactly the same page but the data transferred over the network is a fraction of the original file size.
The algorithm works by finding repeated patterns within a file and replacing them with shorter references. HTML, CSS, and JavaScript files contain a great deal of repetition. HTML uses the same tag names repeatedly. CSS repeats property names, values, and selectors. JavaScript code repeats variable names, function calls, and common syntax patterns. GZIP identifies all these repetitions and encodes them efficiently, typically shrinking a 100 KB JavaScript file to under 30 KB.
Enabling GZIP on a web server requires a small configuration change. On Apache servers, the mod_deflate module is added to the .htaccess file. On Nginx, the gzip on; directive goes into the server configuration block. Managed hosting providers often include a toggle in their control panels. Once enabled, all text-based responses are automatically compressed. Google's PageSpeed Insights tool checks for GZIP and reports it as a high-priority issue when absent because it directly influences page speed scores and Core Web Vitals.
A more modern alternative is Brotli, a compression algorithm developed by Google in 2015. Brotli achieves 15 to 20 percent better compression ratios than GZIP on typical web assets. All modern browsers support Brotli, and services such as Cloudflare apply it automatically. GZIP remains the fallback for older browsers and non-standard environments. Most modern web stacks serve Brotli when supported and fall back to GZIP otherwise, giving the best of both algorithms.
GZIP In Practice
A Cape Town-based insurance comparison website recently reduced their homepage transfer size from 1.2 MB to 380 KB by enabling Brotli with GZIP fallback on their Nginx server. The change required adding four lines to the server configuration. Google PageSpeed scores jumped from 54 to 81 on mobile, which corresponded to a 12 percent reduction in bounce rate over the following month. The site's Core Web Vitals moved from failing to passing for the first time, improving its position in competitive local insurance search results.
For WordPress-based businesses in South Africa, GZIP can be enabled without any server access by installing a caching plugin such as WP Rocket, W3 Total Cache, or LiteSpeed Cache. Each includes a compression module that handles both GZIP and Brotli where available. If you are not sure whether your site uses GZIP, visit gzip.io or run your URL through Google PageSpeed Insights. The result is immediate and the fix is one of the most impactful, lowest-effort technical SEO improvements available to any South African business website.
How GZIP compression works
GZIP is a widely-used data compression method that reduces the size of files sent from a web server to a browser, so pages load faster. It works by the server compressing text-based files, HTML, CSS, JavaScript, and other text resources, before sending them, and the browser decompressing them on arrival, which is fast and standard, since virtually all browsers support GZIP. Because these text files contain a lot of repetition and patterns, GZIP can shrink them substantially, often reducing their size by a large proportion, meaning far less data travels across the network, so pages arrive and load faster, especially on slower connections. GZIP is applied at the server level, enabled in the web server's configuration, and once on, it compresses eligible files automatically for every visitor with no change to the files themselves. It is one of the most effective and standard performance optimisations, since compressing the text resources a page depends on directly reduces download time, which is why enabling GZIP (or a newer alternative) is a basic part of website performance.
GZIP, Brotli and performance
GZIP compression improves site performance by reducing the amount of data transferred, which speeds loading, particularly for the text-based files (HTML, CSS, JavaScript) that make up much of a page's downloaded weight. Its benefit is real and broad, since it applies to every visitor and every eligible file automatically once enabled, and it is a standard, low-effort optimisation, usually just a server configuration setting. A newer compression method, Brotli, often achieves somewhat better compression than GZIP for text files and is increasingly supported, so where available, Brotli can be used for further gains, with GZIP as a reliable, universally-supported fallback; many setups offer both. It is worth noting what compression does and does not apply to: GZIP and Brotli compress text-based files effectively, but already-compressed files such as images (JPEG, PNG, WebP) and video are not meaningfully further compressed by them, since they are already in compressed formats, and are instead optimised through their own methods (correct formats, sizing and image compression). So text compression via GZIP or Brotli, combined with image and other optimisation, minification, caching and a content delivery network, forms the standard toolkit for a fast site. Enabling GZIP (or Brotli) is one of the simplest, most reliably beneficial steps, reducing the transfer size of the text resources that pages depend on, which is why it is a basic expectation of a well-optimised website.
FAQ
Is GZIP or Brotli better for website compression?
Brotli achieves approximately 15 to 20 percent better compression ratios than GZIP for typical web assets and is supported by all modern browsers. GZIP remains the safe fallback for older environments. Most CDNs and modern servers serve Brotli to supporting browsers and GZIP to all others automatically, so you benefit from both algorithms without any extra configuration.
Does GZIP work on image files?
GZIP is designed for text-based files such as HTML, CSS, JavaScript, and JSON. Applying it to already-compressed formats like JPEG, PNG, or WebP produces negligible savings and adds unnecessary server overhead. For images, use dedicated optimisation tools or convert to the WebP or AVIF formats to achieve the best file size reduction without quality loss.