Skip to main content

Cache Headers

free
GET/v1/domain/cache

Analyzes HTTP caching headers to understand how content is cached by browsers and CDNs. Evaluates Cache-Control, ETag, Last-Modified, Vary, and Pragma headers. Detects CDN providers (Cloudflare, Fastly, CloudFront, Vercel, Akamai, Netlify) and reports cache status. Identifies conflicts, security issues, and optimization opportunities.

What It Does

Examines all cache-related HTTP headers and parses Cache-Control directives (max-age, s-maxage, no-cache, no-store, private, public, immutable, stale-while-revalidate, stale-if-error). Detects CDN providers and their cache hit/miss status. Identifies contradictory directives, security risks like Set-Cookie on public responses, and provides a human-readable summary of the caching behavior.

Why It's Useful

Proper caching reduces server load, improves performance, and saves bandwidth. Analyzing cache headers helps identify misconfiguration, contradictory directives, and security issues like sensitive data being cached by shared proxies.

Use Cases

Frontend Developer

Performance Debugging

Debug why content isn't being cached properly by analyzing cache header configuration.

Fix caching issues improving repeat visit performance.

DevOps Engineer

CDN Optimization

Verify cache headers are set correctly for CDN edge caching.

Maximize CDN cache hit rates for better performance and lower origin load.

Security Engineer

Security Review

Ensure sensitive pages have proper no-cache/no-store headers.

Prevent sensitive data from being cached inappropriately.

Parameters

NameTypeRequiredDescription
domainstringRequiredDomain or full URL — accepts `example.com` or `https://example.com/path`.Example: https://example.com
pathstringOptionalOptional path to audit a specific asset (e.g. /static/main.css) — static assets typically have very different cache rules than HTMLExample: /static/main.css

Response Fields

FieldTypeDescription
domainstringThe queried domain (bare hostname).
urlstringFull URL that was fetched, echoing the protocol used in the request.
testedUrlstringThe full URL tested (includes path when supplied)
statusCodenumberHTTP status code of the response
contentTypestringContent-Type of the response
isCacheablebooleanWhether the response is cacheable
summarystringHuman-readable summary of the caching behavior
cacheControlobjectParsed Cache-Control directives (public, private, noCache, noStore, maxAge, sMaxAge, mustRevalidate, proxyRevalidate, noTransform, immutable, staleWhileRevalidate, staleIfError)
cdnTargetedobjectCDN-targeted directives — CDN-Cache-Control (RFC 9213), Cloudflare-CDN-Cache-Control, Vercel-CDN-Cache-Control, Surrogate-Control, Cache-Tag, Surrogate-Key
etagstringETag header value
etagValidatesbooleanWhether If-None-Match returns 304. False indicates ETag is set but conditional validation is broken
lastModifiedstringLast-Modified header value
varyarrayVary header values
expiresstringExpires header value
agenumberAge header value in seconds
pragmastringPragma header value (legacy HTTP/1.0)
effectiveTtlnumberEffective TTL in seconds (priority: s-maxage > max-age > expires)
ttlFormattedstringHuman-readable TTL duration
remainingTtlnumberSeconds of freshness remaining at the edge (effectiveTtl − age)
remainingTtlFormattedstringHuman-readable remaining freshness
freshnessPercentLeftnumber0–100 — percentage of effectiveTtl still fresh
cdnobjectCDN detection result (detected, provider, cacheStatus, edgeLocation)
issuesarrayCaching issues and conflicts detected (including Vary Cookie/Origin antipatterns and stale-at-edge warnings)
recommendationsarrayCaching optimization and security suggestions

Code Examples

cURL
curl "https://api.edgedns.dev/v1/domain/cache" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d "domain=https://example.com"
JavaScript
const response = await fetch(
  'https://api.edgedns.dev/v1/domain/cache?domain=https%3A%2F%2Fexample.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/cache',
    headers={'Authorization': 'Bearer YOUR_API_KEY'},
    params={
    'domain': 'https://example.com'
    }
)

data = response.json()
print(data)

Read the full Cache Headers 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 Cache Headers endpoint live in the playground.