`generateEtags` config doesn't apply to `next/image` responses
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 142k
- Forks
- 32.4k
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 351
Description
Link to the code that reproduces this issue
https://github.com/akhilsugunan77/nextjs-etag-repro
To Reproduce
-
Start the production server (
npm run build && npm start) -
Request the any static chunk and inspect headers:
curl -sI http://localhost:3000/_next/static/chunks/<hash>.jsNo
ETagheader —generateEtags: falseis respected. -
Request an optimized image and inspect headers:
curl -sI "http://localhost:3000/_next/image?url=%2Ftest.jpg&w=256&q=75"ETagheader is present —generateEtags: falseis ignored.
Current vs. Expected behavior
I expected adding generateEtags: false in next config, will disable etag generation for all request. Currently it disables for pages and for static assets (_next/static/).
Static assets:
But for image request it still generates etag
Expected behaviour should be disabling etag generates for all requests.
Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 25.0.0: Wed Sep 17 21:38:03 PDT 2025; root:xnu-12377.1.9~141/RELEASE_ARM64_T8112
Available memory (MB): 24576
Available CPU cores: 8
Binaries:
Node: 24.14.0
npm: 11.9.0
Yarn: N/A
pnpm: 10.14.0
Relevant Packages:
next: 16.2.1-canary.1 // Latest available version is detected (16.2.1-canary.1).
eslint-config-next: N/A
react: 19.2.4
react-dom: 19.2.4
typescript: 5.9.3
Next.js Config:
output: N/A
Which area(s) are affected? (Select all that apply)
Image (next/image)
Which stage(s) are affected? (Select all that apply)
next build (local), next start (local), next dev (local)
Additional context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the reproduction repository and run npm run build && npm start, then compare the headers from the static chunk and /_next/image curl requests. Trace the next/image response handling and the generateEtags configuration path; done means optimized image responses omit ETag when the setting is false, with coverage for this case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nextjs
- Domain
- backend, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100