Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting cache-control header for icon routes results in duplicate header values #70086

Open
ppiwo opened this issue Sep 13, 2024 · 1 comment · May be fixed by #70127
Open

Setting cache-control header for icon routes results in duplicate header values #70086

ppiwo opened this issue Sep 13, 2024 · 1 comment · May be fixed by #70127
Labels
bug Issue was opened via the bug report template. Middleware Related to Next.js Middleware. Runtime Related to Node.js or Edge Runtime with Next.js.

Comments

@ppiwo
Copy link

ppiwo commented Sep 13, 2024

Link to the code that reproduces this issue

https://codesandbox.io/p/devbox/quirky-bassi-x3nw3t

To Reproduce

  1. Open codesandbox link
  2. Open next.config.mjs - note that the cache-control header is being overridden
  3. Open preview in a new tab
  4. Navigate to /favicon.ico
  5. View response headers

Current vs. Expected behavior

Expected: cache-control: max-age=1234
Actual: cache-control: max-age=1234, public, max-age=0, must-revalidate

Provide environment information

Operating System:
  Platform: linux
  Arch: x64
  Version: #1 SMP PREEMPT_DYNAMIC Sun Aug  6 20:05:33 UTC 2023
  Available memory (MB): 4102
  Available CPU cores: 2
Binaries:
  Node: 20.9.0
  npm: 9.8.1
  Yarn: 1.22.19
  pnpm: 8.10.2
Relevant Packages:
  next: 15.0.0-canary.154 // Latest available version is detected (15.0.0-canary.154).
  eslint-config-next: N/A
  react: 19.0.0-rc-94e652d5-20240912
  react-dom: 19.0.0-rc-94e652d5-20240912
  typescript: 5.3.3
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

Middleware, Runtime

Which stage(s) are affected? (Select all that apply)

next dev (local), next build (local), next start (local), Other (Deployed)

Additional context

Overriding the cache-control header in middleware.ts has the same result. This only seems to happen to icons.

@ppiwo ppiwo added the bug Issue was opened via the bug report template. label Sep 13, 2024
@github-actions github-actions bot added Middleware Related to Next.js Middleware. Runtime Related to Node.js or Edge Runtime with Next.js. labels Sep 13, 2024
@ppiwo ppiwo changed the title Setting cache-control header for icon routes results in duplicate headers Setting cache-control header for icon routes results in duplicate header values Sep 13, 2024
@cbratschi
Copy link

Duplicate of #64864

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue was opened via the bug report template. Middleware Related to Next.js Middleware. Runtime Related to Node.js or Edge Runtime with Next.js.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants