Skip to main content

Compression Check

free
GET/v1/domain/compression

Tests HTTP compression support by individually probing gzip, Brotli, zstd, and deflate encodings. Measures uncompressed and compressed sizes to calculate compression ratios. Detects CDN providers and checks for proper Vary: Accept-Encoding headers to prevent cache poisoning.

What It Does

Makes separate requests with individual Accept-Encoding headers (gzip, br, zstd, deflate, identity) to determine exactly which compression algorithms the server supports. Measures the uncompressed baseline size and each encoding's compressed size to calculate compression ratios. Detects the CDN provider, checks the Vary header for correct caching behavior, and identifies the server's preferred encoding when given a full browser-like Accept-Encoding header.

Why It's Useful

Compression can reduce page size by 60-90% for text-based content. Verifying each encoding individually reveals exactly what the server supports — not just what it prefers. Missing Vary: Accept-Encoding headers can cause CDN cache poisoning, where users receive incorrect compressed/uncompressed responses.

Use Cases

Performance Engineer

Performance Optimization

Verify compression is enabled and compare encoding efficiency (gzip vs Brotli vs zstd) as part of web performance optimization.

Identify missing or suboptimal compression with exact byte savings per encoding.

DevOps Engineer

CDN Configuration

Verify CDN is properly compressing responses and serving correct Vary headers to prevent cache poisoning.

Ensure CDN compression settings and caching behavior are correctly configured.

Technical SEO

Competitive Benchmarking

Compare compression implementation across competitor sites to identify performance gaps.

Benchmark compression ratios and encoding support against competitors.

Infrastructure Engineer

Bandwidth Cost Analysis

Measure actual compression ratios to estimate bandwidth savings and CDN cost reduction.

Quantify the bandwidth and cost impact of enabling or upgrading compression.

Parameters

NameTypeRequiredDescription
domainstringRequiredThe domain to check compression forExample: example.com

Response Fields

FieldTypeDescription
domainstringThe queried domain
urlstringThe URL that was tested
statusCodenumberHTTP status code of the response
contentTypestringContent-Type of the response
isCompressedbooleanWhether any compression encoding is supported
isCompressiblebooleanWhether the content type benefits from compression (text/*, JSON, XML, SVG)
encodingstringThe server's preferred encoding when given a full browser-like Accept-Encoding header
encodingsobjectPer-encoding test results (gzip, brotli, zstd, deflate) — each with supported, compressedSize, compressionRatio, and contentEncoding
uncompressedSizenumberUncompressed response size in bytes (baseline measurement)
compressedSizenumberBest compressed size in bytes
compressionRationumberBest compression ratio (e.g., 0.77 = 77% size reduction)
bestEncodingstringThe encoding that achieved the best compression ratio
varyAcceptEncodingbooleanWhether the Vary header includes Accept-Encoding (critical for CDN correctness)
serverstringServer header value
cdnobjectCDN detection result (detected, provider, cacheStatus, edgeLocation)
summarystringHuman-readable summary of the compression analysis
issuesarrayCompression issues detected (missing compression, missing Vary header, etc.)
recommendationsarrayActionable compression optimization suggestions
timestampstringISO 8601 timestamp of the analysis

Code Examples

cURL
curl "https://api.edgedns.dev/v1/domain/compression" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d "domain=example.com"
JavaScript
const response = await fetch(
  'https://api.edgedns.dev/v1/domain/compression?domain=example.com',
  {
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY'
    }
  }
);

const data = await response.json();
console.log(data);
Python
import requests

response = requests.get(
    'https://api.edgedns.dev/v1/domain/compression',
    headers={'Authorization': 'Bearer YOUR_API_KEY'},
    params={
    'domain': 'example.com'
    }
)

data = response.json()
print(data)

Read the full Compression Check guide

Why it matters, real-world use cases, parameters, response fields, and how to call it from Claude, ChatGPT, or Gemini via MCP.

Read the guide →

Related Endpoints

External References

Learn more about the standards and protocols behind this endpoint.

Try This Endpoint

Test the Compression Check endpoint live in the playground.