Compression Check
free/v1/domain/compressionTests 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 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.
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.
Competitive Benchmarking
Compare compression implementation across competitor sites to identify performance gaps.
Benchmark compression ratios and encoding support against competitors.
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
| Name | Type | Required | Description |
|---|---|---|---|
domain | string | Required | The domain to check compression forExample: example.com |
Response Fields
| Field | Type | Description |
|---|---|---|
domain | string | The queried domain |
url | string | The URL that was tested |
statusCode | number | HTTP status code of the response |
contentType | string | Content-Type of the response |
isCompressed | boolean | Whether any compression encoding is supported |
isCompressible | boolean | Whether the content type benefits from compression (text/*, JSON, XML, SVG) |
encoding | string | The server's preferred encoding when given a full browser-like Accept-Encoding header |
encodings | object | Per-encoding test results (gzip, brotli, zstd, deflate) — each with supported, compressedSize, compressionRatio, and contentEncoding |
uncompressedSize | number | Uncompressed response size in bytes (baseline measurement) |
compressedSize | number | Best compressed size in bytes |
compressionRatio | number | Best compression ratio (e.g., 0.77 = 77% size reduction) |
bestEncoding | string | The encoding that achieved the best compression ratio |
varyAcceptEncoding | boolean | Whether the Vary header includes Accept-Encoding (critical for CDN correctness) |
server | string | Server header value |
cdn | object | CDN detection result (detected, provider, cacheStatus, edgeLocation) |
summary | string | Human-readable summary of the compression analysis |
issues | array | Compression issues detected (missing compression, missing Vary header, etc.) |
recommendations | array | Actionable compression optimization suggestions |
timestamp | string | ISO 8601 timestamp of the analysis |
Code Examples
curl "https://api.edgedns.dev/v1/domain/compression" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d "domain=example.com"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);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.