Testing Tools & Resources

Comprehensive tools for testing and monitoring HTTP compression

Online Testing Tools

Compression Testers

  • GIDNetwork GZIP Test
  • Gift of Speed Compression Test
  • WebPageTest (Advanced metrics)
  • GTmetrix Compression Analysis
  • Varvy SEO Tool

Performance Analyzers

  • Google PageSpeed Insights
  • Lighthouse (Chrome DevTools)
  • Pingdom Website Speed Test
  • KeyCDN Performance Test
  • Dotcom-Tools Website Speed

Header Inspectors

  • REDbot HTTP Header Checker
  • HTTP Header Checker by KeyCDN
  • SecurityHeaders.com
  • Chrome DevTools Network Tab
  • Firefox Developer Tools

Command-Line Tools

cURL Commands

# Check if compression is enabled
curl -H "Accept-Encoding: gzip, deflate, br" -I https://example.com

# Download compressed content and check size
curl -H "Accept-Encoding: gzip" -o /dev/null -w "%{size_download}\n" https://example.com

# Compare compressed vs uncompressed
curl -o /dev/null -w "Uncompressed: %{size_download}\n" https://example.com
curl -H "Accept-Encoding: gzip" -o /dev/null -w "Compressed: %{size_download}\n" https://example.com

# View response headers
curl -H "Accept-Encoding: gzip, br" -v https://example.com 2>&1 | grep -i encoding

HTTPie Testing

# Install HTTPie
pip install httpie

# Test compression
http https://example.com Accept-Encoding:gzip,br

# Check headers only
http --headers https://example.com Accept-Encoding:gzip

# Download and save compressed response
http --download https://example.com Accept-Encoding:br

Browser Developer Tools

Chrome DevTools

  1. Open DevTools (F12)
  2. Go to Network tab
  3. Reload the page
  4. Click on any resource
  5. Check Response Headers for Content-Encoding
  6. View Size column (transferred vs actual)

Console Commands

// Check compression ratio in Chrome Console
performance.getEntriesByType('resource').forEach(resource => {
    if (resource.encodedBodySize > 0 && resource.decodedBodySize > 0) {
        const ratio = ((1 - resource.encodedBodySize / resource.decodedBodySize) * 100).toFixed(2);
        console.log(`${resource.name.split('/').pop()}: ${ratio}% compressed`);
    }
});

Automated Testing

Node.js Test Script

const https = require('https');
const zlib = require('zlib');

function testCompression(url) {
    const encodings = ['gzip', 'br', 'deflate', 'identity'];
    
    encodings.forEach(encoding => {
        const options = {
            headers: { 'Accept-Encoding': encoding }
        };
        
        https.get(url, options, (res) => {
            let size = 0;
            res.on('data', chunk => size += chunk.length);
            res.on('end', () => {
                console.log(`${encoding}: ${size} bytes, ` +
                           `Content-Encoding: ${res.headers['content-encoding'] || 'none'}`);
            });
        });
    });
}

testCompression('https://example.com');

Python Testing Script

import requests
import gzip
import brotli

def test_compression(url):
    encodings = ['gzip', 'br', 'deflate', 'identity']
    
    for encoding in encodings:
        headers = {'Accept-Encoding': encoding}
        response = requests.get(url, headers=headers)
        
        content_encoding = response.headers.get('Content-Encoding', 'none')
        content_length = len(response.content)
        
        print(f"{encoding}: {content_length} bytes, "
              f"Content-Encoding: {content_encoding}")
        
        # Verify decompression
        if content_encoding == 'gzip':
            decompressed = gzip.decompress(response.content)
        elif content_encoding == 'br':
            decompressed = brotli.decompress(response.content)
        
        print(f"  Decompressed size: {len(decompressed)} bytes")

test_compression('https://example.com')

Continuous Monitoring

Monitoring Solutions

  1. Synthetic Monitoring: Pingdom, UptimeRobot, StatusCake
  2. Real User Monitoring: Google Analytics, New Relic
  3. APM Tools: DataDog, AppDynamics, Dynatrace
  4. Log Analysis: ELK Stack, Splunk, Sumo Logic
  5. CDN Analytics: Cloudflare, Fastly, Akamai

Compression Benchmarking

Benchmark Script

#!/bin/bash
# Compression benchmark script

URL="https://example.com/large-file.json"
ITERATIONS=10

echo "Benchmarking compression for $URL"
echo "Running $ITERATIONS iterations..."

for encoding in "gzip" "br" "deflate" "identity"; do
    echo -e "\nTesting $encoding:"
    total_time=0
    total_size=0
    
    for i in $(seq 1 $ITERATIONS); do
        result=$(curl -o /dev/null -s -w "%{time_total},%{size_download}" \
                 -H "Accept-Encoding: $encoding" "$URL")
        
        time=$(echo $result | cut -d',' -f1)
        size=$(echo $result | cut -d',' -f2)
        
        total_time=$(echo "$total_time + $time" | bc)
        total_size=$(echo "$total_size + $size" | bc)
    done
    
    avg_time=$(echo "scale=3; $total_time / $ITERATIONS" | bc)
    avg_size=$(echo "scale=0; $total_size / $ITERATIONS" | bc)
    
    echo "  Average time: ${avg_time}s"
    echo "  Average size: ${avg_size} bytes"
done

Browser Extensions

Chrome Extensions

  • HTTP Headers
  • ModHeader
  • Web Developer
  • Lighthouse

Firefox Add-ons

  • HTTP Header Live
  • RESTClient
  • Web Developer
  • Network Monitor

Testing Checklist

Compression Testing Checklist

  1. ✓ Verify Accept-Encoding request header
  2. ✓ Check Content-Encoding response header
  3. ✓ Compare transferred vs actual size
  4. ✓ Test all supported encodings
  5. ✓ Verify Vary: Accept-Encoding header
  6. ✓ Check compression for all content types
  7. ✓ Test minimum size threshold
  8. ✓ Verify no double compression
  9. ✓ Test CDN compression if applicable
  10. ✓ Monitor compression ratio over time