vercel / vercel/next.js

`generateEtags` config doesn't apply to `next/image` responses

Open
#91,684 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Image (next/image)
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
  1. Start the production server (npm run build && npm start)

  2. Request the any static chunk and inspect headers:

    curl -sI http://localhost:3000/_next/static/chunks/<hash>.js
    

    No ETag headergenerateEtags: false is respected.

  3. Request an optimized image and inspect headers:

    curl -sI "http://localhost:3000/_next/image?url=%2Ftest.jpg&w=256&q=75"
    

    ETag header is presentgenerateEtags: false is 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:
Image

But for image request it still generates etag
Image

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.