GZIP is a compression method that shrinks files before the server sends them to a browser.
GZIP is a way of making files smaller so they travel faster across the internet. When a browser asks for a web page, the server compresses the HTML, CSS and JavaScript with GZIP, sends the smaller version, and the browser unpacks it instantly. Visitors see exactly the same page, just sooner.
Text compresses very well. A 100 KB stylesheet often shrinks to around 20 to 30 KB with GZIP, because code is full of repeated words and patterns.
How GZIP compression works
- The browser sends a request with a header saying which compression it understands, such as
Accept-Encoding: gzip, br. - The server compresses the file, or uses a copy it compressed earlier.
- It sends the response with a
Content-Encoding: gzipheader. - The browser decompresses it and displays the page.
GZIP finds repeated strings in a file and replaces them with short references to where they appeared before. Every modern browser supports it.
Why GZIP matters for your website
Smaller files mean faster downloads, especially on mobile connections. That improves loading times, helps Core Web Vitals scores and reduces the bandwidth your site uses. Tools like Google PageSpeed Insights flag missing text compression as an easy win.
GZIP vs Brotli
Brotli is a newer compression method developed by Google. It usually produces files 15 to 20% smaller than GZIP for the same content. Most browsers support both, and servers send Brotli when the browser asks for it and GZIP otherwise. You don't have to choose. Having both enabled gives every visitor the best option their browser supports.
What GZIP should and shouldn't compress
- Compress: HTML, CSS, JavaScript, JSON, XML, SVG and plain text.
- Don't compress: JPEG, PNG, WebP, MP4, PDF and ZIP files. They're already compressed, so GZIP adds work without making them smaller.
How to check if GZIP is enabled
- Open your browser's developer tools, go to the Network tab, click a file and look for
content-encoding: gziporbrin the response headers. - Run your site through an online compression checker or PageSpeed Insights.
If it's missing, it can often be turned on in your .htaccess file, a caching plugin or your CDN settings. On LiteSpeed servers like AblePage's, GZIP is on by default.