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
domainstringRequiredThe domain to analyze cache headers forExample: example.com

Response Fields

FieldTypeDescription
domainstringThe queried domain
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)
etagstringETag header value
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
cdnobjectCDN detection result (detected, provider, cacheStatus, edgeLocation)
issuesarrayCaching issues and conflicts detected
recommendationsarrayCaching optimization and security suggestions

Code Examples

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