Problem
A next.config headers() rule is appended after vinext's default Cache-Control rather than overriding it, producing two Cache-Control headers.
Repro
curl -sI http://localhost:3000/fonts/Source-Code-Pro-Regular.woff2 | grep -i '^cache-control'
# Cache-Control: public, max-age=3600 <- vinext default (first)
# cache-control: public, max-age=31536000, immutable <- next.config headers() rule
(next.config.js declares an immutable rule for /fonts/:path*.) Per HTTP header-combining rules, a shared cache may take the first max-age (3600), so the intended immutable long-cache can be ineffective.
Suggested fix
A matching headers() rule should replace vinext's default value for that header key, not append a second header.
Problem
A
next.configheaders()rule is appended after vinext's defaultCache-Controlrather than overriding it, producing twoCache-Controlheaders.Repro
(
next.config.jsdeclares an immutable rule for/fonts/:path*.) Per HTTP header-combining rules, a shared cache may take the firstmax-age(3600), so the intendedimmutablelong-cache can be ineffective.Suggested fix
A matching
headers()rule should replace vinext's default value for that header key, not append a second header.