HTML Compression/GZIP Test
What is it?
Check if your website is using HTML compression. HTML compression plays an important role in improving website speed by finding similar strings within a text file and replacing them temporarily to reduce overall file size.
Pass rate:
-
Top 100 websites: 99%This value indicates the percent of top 100 most visited websites in the US that pass this test (in the past 12 months).
-
All websites: 94%This value indicates the percent of all websites analyzed in SEO Site Checkup (500,000+) in the past 12 months.
| 2021 | 96% |
|---|---|
| 2022 | 97% |
| 2023 | 97% |
| 2024 | 99% |
100
75
50
25
0
How do I fix it?
Your two options for file compression are Deflate and GZIP.
- Deflate is an option which comes automatically with the Apache server and which is simple to set up.
- GZIP on the other hand needs to be installed and requires a bit more work to install. However, GZIP does achieve a higher compression rate and therefore might be a better choice if your website uses pages which have a lot of images or large file sizes.
Setting up file compression for your website will depend on which type of server you're using for your website. Most likely, you'll be using Apache, which means you can enable compression by adding a few deflate codes to your .htaccess file.
# compress text, html, javascript, css, xml: 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
For more advanced information regarding deflate you can check this Apache documentation.