Access-Control-Max-Age Header Explained

What the HTTP Access-Control-Max-Age header does and when it's used.

Published October 15, 2026

Access-Control-Max-Age tells the browser how many seconds it may cache the preflight result, reducing repeated OPTIONS requests.

How it works

Browsers cap it (Chrome 2 hours, Firefox 24 hours).

The Access-Control-Max-Age header is part of the HTTP message and is case-insensitive in name.

In a real exchange

curl -i https://example.com/
Access-Control-Max-Age: 86400
Where Access-Control-Max-Age appears.

Practical examples

The header

Access-Control-Max-Age: 86400

Set or use it in code

res.set('Access-Control-Max-Age', '86400')

Inspect it

curl -sI https://example.com | grep -i 'access-control-max-age'

Common mistakes

  • Setting a very low value and causing extra preflights
  • Expecting changes to apply immediately
  • Caching a wrong CORS configuration

Key takeaways

  • Access-Control-Max-Age: Access-Control-Max-Age tells the browser how many seconds it may cache the preflight result, reducing repeated OPTIONS requests.
  • Check it in browser DevTools → Network.
  • Test with curl -I before deploying.

FAQ

What is the default?

Typically 5 seconds if absent.

Is Access-Control-Max-Age case sensitive?

Header names are case-insensitive; values may not be.

More HTTP articles