Skip to main content

How to fix: Missing Cache-Control header

No Cache-Control header is present, leaving caching behavior undefined and potentially caching sensitive responses.

Why it matters

Without explicit Cache-Control, browsers and intermediary proxies may cache sensitive pages, exposing authenticated content to subsequent users on shared devices or to cached responses on a CDN.

All responses should have an explicit Cache-Control directive appropriate to the content type.

How to fix it

  1. 1For sensitive/authenticated pages: Cache-Control: no-store
  2. 2For static assets: Cache-Control: public, max-age=31536000, immutable
  3. 3For dynamic pages: Cache-Control: no-cache, must-revalidate

Code examples

Next.js: sensitive pages

JavaScript
export default {
  async headers() {
    return [
      { source: "/(dashboard|account|admin)(.*)", headers: [{ key: "Cache-Control", value: "no-store, max-age=0" }] },
      { source: "/_next/static/(.*)", headers: [{ key: "Cache-Control", value: "public, max-age=31536000, immutable" }] },
    ];
  },
};

References

Detected automatically by VulnRadar. The check id is cache-control-missing, stable across every scan so you can filter or diff on it.

See every headers check

Questions

How severe is Missing Cache-Control header?
VulnRadar rates this low severity in the headers category. The severity is fixed per check, not scored per site, so the same finding is the same severity on every scan.
Does VulnRadar check for this automatically?
Yes. It runs as part of every scan under the check id cache-control-missing, which stays the same between runs so you can filter, diff, or gate CI on it.

Missing a check?

The detection set is open. If you know a misconfiguration this does not catch, propose it: the issue template asks for the threat model, how to detect it, the false-positive risk, and a test fixture, which is the same thing a maintainer would have to work out anyway.

Propose a checkHow a check is built

Scan your own site for missing cache-control header

VulnRadar runs this check and hundreds more against a URL in seconds. No agent to install, just paste a URL.

Or scan this site as a demoRead the docs

How to fix: Missing Cache-Control header | VulnRadar