Beamfar

How to inspect HTTP response headers, caching, compression and CORS in production

Every browser navigation, API request and search crawl starts with HTTP response headers. Long before a single byte of HTML or JSON renders, those key-value lines decide whether a CDN serves a page in 25 milliseconds or hammers your origin database, whether a browser compresses the transfer with Brotli or ships raw megabytes, whether cookies leak over plain HTTP, and whether another origin can read authenticated responses via CORS.

When something breaks after a deploy or hosting migration — a suddenly slow store, a blocked API call in Chrome DevTools, or a login cookie dropped on redirect — reading the exact live HTTP response headers from outside your local network usually pinpoints the root cause in under ten seconds.

Four header groups to inspect on every production release

1. Status, protocol and server version leaks

Under RFC 9110, inspect the exact final status code alongside transport headers:

  • HTTP version & Alt-Svc: Modern sites serve HTTP/2 over TLS and advertise Alt-Svc: h3=":443" when HTTP/3 (QUIC) is available.
  • Server, X-Powered-By and X-Generator: Default Nginx, Apache, PHP and Express configurations often broadcast exact version strings (X-Powered-By: PHP/8.1.12, Server: Apache/2.4.52). Stripping version headers removes easy fingerprinting signals (server_tokens off; in Nginx, expose_php = Off in php.ini, app.disable('x-powered-by') in Express).

2. Caching, CDN status and compression (RFC 9111)

Under RFC 9111, caching headers separate fast, resilient websites from overloaded origins:

  • Cache-Control: Distinguish between public cacheable documents (public, max-age=300, stale-while-revalidate=60), fingerprinted static assets (public, max-age=31536000, immutable) and private personalized/checkout routes (private, no-store).
  • CDN cache indicators: Read CF-Cache-Status (Cloudflare), X-Cache (CloudFront/Fastly/Varnish), X-Vercel-Cache, X-LiteSpeed-Cache, X-FastCGI-Cache and Age. Seeing BYPASS or DYNAMIC on public marketing pages or product listings almost always explains a high Time to First Byte (TTFB).
  • Content-Encoding & Vary: Confirm HTML, CSS, JS and JSON return br (Brotli), zstd or gzip alongside Vary: Accept-Encoding so proxies never hand compressed bytes to incompatible clients.

3. CORS and cross-origin isolation headers

Per MDN’s CORS specification, misconfigured CORS headers either break legitimate frontend apps or expose private user data:

  • Never combine wildcard origin with credentials: Access-Control-Allow-Origin: * paired with Access-Control-Allow-Credentials: true is rejected by browsers and signals a broken CORS policy — reflect only an explicit allowlist of trusted origins when credentials are enabled.
  • Avoid blind origin reflection: Reflecting any arbitrary Origin header back into Access-Control-Allow-Origin alongside Access-Control-Allow-Credentials: true allows third-party sites to make authenticated cross-origin reads.
  • Cross-origin defense headers: Cross-Origin-Opener-Policy: same-origin and Cross-Origin-Resource-Policy: same-origin isolate browsing contexts and prevent unauthorized cross-site embedding.

Whenever a server sets session or auth cookies on HTTPS, verify three defensive flags defined in MDN’s Set-Cookie reference:

  • Secure: Prevents browsers from ever transmitting the cookie over unencrypted http://.
  • HttpOnly: Blocks client-side JavaScript (document.cookie) from reading session tokens if an XSS bug occurs.
  • SameSite=Lax (or Strict): Stops routine cross-site request forgery (CSRF) submissions.

Check it now. The HTTP response header, cache & CORS checker inspects live HTTP status, protocol and HTTP/3 Alt-Svc, Server and X-Powered-By version leaks, Cache-Control, CDN cache HIT/MISS, Brotli/gzip compression, CORS rules and Set-Cookie flags; the security headers checker reads a page’s HSTS, CSP, X-Content-Type-Options, frame protection, Referrer-Policy and Permissions-Policy. No account, and the address is not stored.

Common post-deploy HTTP header regressions

Even carefully reviewed releases introduce subtle header regressions when a new reverse proxy rule, WordPress plugin or CDN worker goes live:

  • Accidental Set-Cookie on public HTML: A single marketing or language-switcher plugin emitting Set-Cookie on anonymous GET requests makes Cloudflare, Varnish and Fastly bypass edge caching for every visitor, turning 35 ms edge hits into 900 ms origin hits.
  • Conflicting Cache-Control directives: Sending both max-age=3600 from Nginx and no-cache, must-revalidate from an upstream PHP or Node process leaves browsers and shared proxies obeying the strictest directive (no-cache) instead of caching.
  • Over-broad Vary headers: Adding Vary: User-Agent or Vary: Cookie fragments CDN cache keys across thousands of permutations, collapsing hit ratios even when Cache-Control: public looks healthy. Keep Vary minimal (Vary: Accept-Encoding, plus Origin only on endpoints that reflect allowed CORS origins).
  • Missing Access-Control-Max-Age on API preflights: Without a preflight cache duration on OPTIONS responses, every authenticated cross-origin POST or PUT pays double round-trip latency before the real payload leaves the browser.

Copy-paste hardening snippets

Nginx (strip version leaks + Brotli/gzip + clean caching)

server_tokens off;
gzip on;
gzip_vary on;
gzip_types text/plain text/css application/json application/javascript application/xml image/svg+xml;

location /static/ {
  add_header Cache-Control "public, max-age=31536000, immutable";
}

Quick CLI header check

curl -sSIL --http2 https://example.com/ | grep -iE '^(http/|server:|x-powered-by:|cache-control:|cf-cache-status:|x-cache:|content-encoding:|access-control-|set-cookie:|alt-svc:)'

How Beamfar helps

Inspect any public URL right now without opening a terminal using the free, zero-storage HTTP response header, cache & CORS checker — it audits status, protocol, HTTP/3 Alt-Svc, server version leaks, Cache-Control, CDN cache status, compression, CORS headers and Set-Cookie security flags (without storing or printing cookie values). Pair it with the security headers checker for OWASP headers and the TTFB checker for full timing breakdowns. For continuous monitoring across client portfolios, Beamfar tracks uptime, response times, headers, TLS, DNS, SEO and external security from two European Union regions starting on a permanent 1-site Free plan.

Questions

Why does a page return HTTP 200 but still feel slow on every visit?

Check the Cache-Control, CF-Cache-Status, X-Cache and Age headers. If a WordPress cookie or Cache-Control: no-store forces the CDN into BYPASS or DYNAMIC mode on public pages, every visitor hits your origin PHP and database instead of an edge cache.

Is exposing Server: nginx or X-Powered-By: PHP a critical vulnerability?

By itself, a version banner is an information leak rather than a direct breach, but automated scanners use exact version strings to match known CVEs quickly. Turning off server_tokens in Nginx and expose_php in PHP is a clean, zero-downtime hardening step.

Why does my browser block a fetch() request even though the API answered HTTP 200?

Browser CORS checks inspect Access-Control-Allow-Origin, Access-Control-Allow-Methods and Access-Control-Allow-Credentials on the preflight OPTIONS and actual response. If the header is missing, mismatched, or combines * with credentials, the browser hides the response body from JavaScript.

Does inspecting Set-Cookie headers expose private session values?

No. A passive external check sends no user login credentials and inspects only cookie attribute flags (Secure, HttpOnly, SameSite) without storing or displaying raw cookie values.

Sources

Read on . Standards and vendor pages change; confirm the current text before you rely on it.

Terms used in this guide

  • HTTP status codeAn HTTP status code is the three-digit number that opens a server’s response: 2xx success, 3xx redirect, 4xx client error, 5xx server error.
  • HSTSHSTS is a response header telling browsers to use only HTTPS for a site. What max-age and includeSubDomains do, and why an expired certificate then hurts.
  • RedirectA redirect is an HTTP response that sends a visitor or crawler to another URL. The permanent and temporary status codes and how Google treats each.
  • TTLTTL is the number of seconds a DNS answer may be cached: why changes spread slowly, how to lower it before a change, and why it is a maximum.

Try it on your own sites.

Add your sites: checking starts as soon as you do.

No card for the Free plan.