Compression Headers Auditor avatar

Compression Headers Auditor

Pricing

Pay per usage

Go to Apify Store
Compression Headers Auditor

Compression Headers Auditor

Audit a public URL's HTTP compression headers for gzip, brotli, zstd, and deflate. Detects double-compression, re-compression of binary content, and missing Vary negotiation.

Pricing

Pay per usage

Rating

0.0

(0)

Developer

Sanskar Jaiswal

Sanskar Jaiswal

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

4 days ago

Last modified

Share

Audit a public URL's HTTP compression headers in one API call. Returns detection for gzip, brotli, zstd, and deflate in Content-Encoding, checks Vary: Accept-Encoding is present during negotiation, flags re-compression of already-compressed binary content (images, fonts, videos, archives), detects double-compression and legacy Transfer-Encoding: gzip, and returns a content-aware compressibility score, letter grade, and performance recommendations. Built for performance engineers, devops teams, and site migration QA.

Use cases

  • Performance engineers - verify brotli/gzip/zstd are correctly applied to text-based resources before launches and CDN cutovers
  • Devops teams - catch compression regressions after edge config changes, origin moves, or CDN rule edits
  • Site migration QA - confirm compression policies survive moves between frameworks, origins, and edge providers
  • Frontend platform teams - detect wasted CPU from re-compressing already-compressed binary formats (JPEG, PNG, WOFF2, PDF, WASM)
  • Agency consultants - batch-audit client pages and return structured compression recommendations

Input

FieldTypeRequiredDefaultDescription
startUrlstringyes-Public URL to audit
useHeadRequestbooleannofalseUse HEAD instead of GET (some servers return different headers on HEAD)
timeoutSecondsintegerno10Per-request timeout (3-30 seconds)

Example input

{
"startUrl": "https://example.com",
"useHeadRequest": false,
"timeoutSeconds": 10
}

Output

A single dataset item with the full audit:

FieldTypeDescription
inputUrlstringThe URL provided as input
finalUrlstringFinal URL after redirects
httpsbooleanWhether the final response was served over HTTPS
statusintegerFinal HTTP status code
contentTypestringContent-Type of the final response
resourceClassstringContent class: static-asset, html, already-compressed, or other
contentEncodingstring | nullParsed Content-Encoding value (e.g., gzip, br, zstd, deflate), or null if absent
transferEncodingstring | nullParsed Transfer-Encoding value (e.g., chunked), or null if absent
compressionsarrayOrdered list of detected compression algorithms in Content-Encoding
varyAcceptEncodingbooleanWhether Vary includes Accept-Encoding
varyarrayTokenized Vary header values
contentLengthinteger | nullContent-Length response header value, or null
headersarrayPer-header analysis (see below)
issuesarrayAggregated issue descriptions
scoreintegerCompression readiness score (0-100)
gradestringLetter grade (A+, A, B, C, D, E, F)
checkedAtstringISO 8601 timestamp
recommendationsarrayActionable recommendations for improving compression

headers array

Each entry contains:

FieldTypeDescription
namestringDisplay name of the header check
headerstringCanonical header key
statusstringgood, warn, missing, or info
notestringHuman-readable explanation of the current state
weightintegerWeight of this check in the score
recommendationstring | nullFix recommendation, or null when the header is good

Headers checked

CheckHeader(s)What is checked
Content-EncodingContent-Encodingpresence, standard algorithm (gzip, br, zstd, deflate), double-compression, re-compression of already-compressed content types
VaryVarywhether Accept-Encoding is included when Content-Encoding is negotiated (prevents serving compressed responses to unsupported clients)
Compression AlgorithmContent-Encodingalgorithm quality assessment: brotli for text, zstd for modern compression, gzip for compatibility
Transfer-EncodingTransfer-Encodingflags legacy Transfer-Encoding: gzip (largely unsupported in HTTP/2+)

Resource-aware scoring

The auditor classifies the response as static-asset (CSS, JS, JSON, XML, plain text), html (text/html, xhtml), already-compressed (images, fonts, videos, audio, archives, PDF, WASM), or other. Expectations differ:

  • Text-based resources (HTML, CSS, JS, JSON) should use Content-Encoding: gzip or br (brotli preferred for ~15-25% better compression on text).
  • Already-compressed content types (JPEG, PNG, WebP, WOFF2, MP4, ZIP, PDF, WASM) should NOT be re-compressed; doing so wastes CPU at the edge and rarely saves bytes.
  • Vary: Accept-Encoding must be present whenever Content-Encoding is negotiated, so caches do not serve brotli/gzip to clients that only accept identity.

Grading scale

Score rangeGrade
95-100A+
85-94A
75-84B
65-74C
50-64D
30-49E
0-29F

Example output

{
"inputUrl": "https://example.com",
"finalUrl": "https://example.com/",
"https": true,
"status": 200,
"contentType": "text/html; charset=UTF-8",
"resourceClass": "html",
"contentEncoding": "gzip",
"transferEncoding": null,
"compressions": ["gzip"],
"varyAcceptEncoding": true,
"vary": ["accept-encoding"],
"contentLength": 648,
"headers": [
{
"name": "Content-Encoding",
"header": "content-encoding",
"status": "good",
"note": "Content-Encoding: gzip. gzip (widely compatible).",
"weight": 40,
"recommendation": null
},
{
"name": "Vary: Accept-Encoding",
"header": "vary",
"status": "good",
"note": "Vary includes Accept-Encoding. Content negotiation for compression is correctly signalled.",
"weight": 30,
"recommendation": null
}
],
"issues": [],
"score": 70,
"grade": "C",
"checkedAt": "2026-08-13T12:00:00.000Z",
"recommendations": [
"Compression headers look well-configured for this content type. Run this audit after edge/CDN changes to catch regressions."
]
}

Security

  • Only public HTTP/HTTPS URLs are accepted
  • SSRF protection: localhost, private IPv4/IPv6, and DNS-resolving-to-private IPs are blocked
  • URLs with embedded credentials are rejected
  • Redirects are manually revalidated before following (max 3)
  • No browser automation, no cookies stored, no body retained
  • The actor drains the response body after reading headers (GET by default; HEAD optional)

Pricing

Pay per event:

EventPrice
Actor start$0.005
URL audited$0.01

A single URL audit costs approximately $0.015.

FAQ

How is this different from the Cache Headers Auditor? The Cache Headers Auditor checks caching directives (Cache-Control, ETag, Last-Modified, Expires, Vary, Age). This actor focuses exclusively on compression: Content-Encoding algorithm choice, Vary: Accept-Encoding negotiation, re-compression of already-compressed content, double-compression, and Transfer-Encoding legacy issues.

How is this different from the HTTP Compression Checker actor? The HTTP Compression Checker reports whether a URL serves brotli/gzip/deflate and whether Vary: Accept-Encoding is present. This actor adds: zstd support, already-compressed content-type detection (prevents wasted CPU re-compressing JPEG/PNG/WOFF2/PDF/WASM), double-compression detection, Transfer-Encoding legacy warnings, compression-choice quality scoring, content-aware compressibility scoring, and structured devops recommendations per resource class.

Does the actor fetch the body? By default it issues a GET request and drains the body without parsing it. Use useHeadRequest: true to issue a HEAD instead; some servers return different headers on HEAD, so GET is safer by default.

Can I audit static assets (CSS, JS, images, fonts)? Yes. The actor classifies the response using Content-Type and applies different expectations: text-based static assets should be compressed, but already-compressed content (images, fonts, videos, archives, PDF, WASM) should NOT be re-compressed.

Does the actor follow redirects? Yes, up to 3 redirects. Each redirect target is revalidated for SSRF safety before it is followed.