From 811364b89239aa5507cc7555cb198e41d893bee8 Mon Sep 17 00:00:00 2001 From: Tim Neutkens Date: Thu, 14 Sep 2023 12:53:47 +0200 Subject: [PATCH] Ensure etags are not generated for static files when disabled --- packages/next/src/server/lib/router-server.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/next/src/server/lib/router-server.ts b/packages/next/src/server/lib/router-server.ts index 7e24bb9bd5ce0..ca4ccab38227d 100644 --- a/packages/next/src/server/lib/router-server.ts +++ b/packages/next/src/server/lib/router-server.ts @@ -510,6 +510,8 @@ export async function initialize(opts: { try { return await serveStatic(req, res, matchedOutput.itemPath, { root: matchedOutput.itemsRoot, + // Ensures that etags are not generated for static files when disabled. + etag: config.generateEtags, }) } catch (err: any) { /**