Cache Headers
free/v1/domain/cacheAnalyzes 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
Performance Debugging
Debug why content isn't being cached properly by analyzing cache header configuration.
Fix caching issues improving repeat visit performance.
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 Review
Ensure sensitive pages have proper no-cache/no-store headers.
Prevent sensitive data from being cached inappropriately.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
domain | string | Required | Domain or full URL — accepts `example.com` or `https://example.com/path`.Example: https://example.com |
path | string | Optional | Optional 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
| Field | Type | Description |
|---|---|---|
domain | string | The queried domain (bare hostname). |
url | string | Full URL that was fetched, echoing the protocol used in the request. |
testedUrl | string | The full URL tested (includes path when supplied) |
statusCode | number | HTTP status code of the response |
contentType | string | Content-Type of the response |
isCacheable | boolean | Whether the response is cacheable |
summary | string | Human-readable summary of the caching behavior |
cacheControl | object | Parsed Cache-Control directives (public, private, noCache, noStore, maxAge, sMaxAge, mustRevalidate, proxyRevalidate, noTransform, immutable, staleWhileRevalidate, staleIfError) |
cdnTargeted | object | CDN-targeted directives — CDN-Cache-Control (RFC 9213), Cloudflare-CDN-Cache-Control, Vercel-CDN-Cache-Control, Surrogate-Control, Cache-Tag, Surrogate-Key |
etag | string | ETag header value |
etagValidates | boolean | Whether If-None-Match returns 304. False indicates ETag is set but conditional validation is broken |
lastModified | string | Last-Modified header value |
vary | array | Vary header values |
expires | string | Expires header value |
age | number | Age header value in seconds |
pragma | string | Pragma header value (legacy HTTP/1.0) |
effectiveTtl | number | Effective TTL in seconds (priority: s-maxage > max-age > expires) |
ttlFormatted | string | Human-readable TTL duration |
remainingTtl | number | Seconds of freshness remaining at the edge (effectiveTtl − age) |
remainingTtlFormatted | string | Human-readable remaining freshness |
freshnessPercentLeft | number | 0–100 — percentage of effectiveTtl still fresh |
cdn | object | CDN detection result (detected, provider, cacheStatus, edgeLocation) |
issues | array | Caching issues and conflicts detected (including Vary Cookie/Origin antipatterns and stale-at-edge warnings) |
recommendations | array | Caching optimization and security suggestions |
Code Examples
curl "https://api.edgedns.dev/v1/domain/cache" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d "domain=https://example.com"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);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.