How To Check If My Server Is Serving GZipped Content?

Published July 21, 2024

Problem: Checking for GZipped Content

GZipped content can improve website loading speeds. However, confirming if a server is serving GZipped content is not always easy. This check is important to verify that compression works as intended.

Checking for GZipped Content

Using Browser Developer Tools

To check if your server is serving GZipped content using browser developer tools:

  1. Open your website in a browser
  2. Right-click and select "Inspect" or press F12
  3. Go to the Network tab
  4. Reload the page
  5. Click on a file in the Network tab
  6. Look for "Content-Encoding" in the Response Headers

If you see "gzip" as the value for Content-Encoding, your server is serving GZipped content for that file.

Verify Multiple Resources

When checking for GZip compression in browser developer tools, don't stop at just one file. Check multiple resources like HTML, CSS, and JavaScript files to make sure GZip is applied across different types of content.

Command-Line Tools for GZip Verification

You can use cURL to check for GZip compression:

  1. Open a terminal or command prompt
  2. Run this command:
curl -H "Accept-Encoding: gzip" -I http://your-website.com
  1. Look for "Content-Encoding: gzip" in the output

If you see this header, your server is serving GZipped content.

To compare the size of compressed and uncompressed content:

  1. Run this command for uncompressed size:
curl http://your-website.com --silent --write-out "%{size_download}\n" --output /dev/null
  1. Run this command for compressed size:
curl http://your-website.com --silent -H "Accept-Encoding: gzip,deflate" --write-out "%{size_download}\n" --output /dev/null
  1. Compare the two numbers. A smaller second number indicates compression is working.

Online GZip Testing Tools

Several web-based tools can check for GZip compression:

  1. GIDZipTest (https://www.gidnetwork.com/tools/gzip-test.php)
  2. CheckGZipCompression (https://checkgzipcompression.com/)
  3. WebPageTest (https://www.webpagetest.org/)

To use these tools:

  1. Enter your website URL
  2. Click the "Test" or "Check" button
  3. Review the results, which show if GZip is enabled and the compression ratio

These tools offer a quick way to verify GZip compression without technical knowledge.

Example: Using WebPageTest for GZip Analysis

When using WebPageTest:

  1. Enter your website URL and run the test
  2. Go to the "Content" tab in the results
  3. Look for the "Compression Savings" column
  4. A value greater than 0 indicates GZip compression is active
  5. Click on individual resources to see detailed compression information