#How to disable static caching of 404s?

1 messages · Page 1 of 1 (latest)

lusty willow
#

With Next.js v14 is there a way to prevent Next.js from creating static files for 404s in .next/server/app? There is constant crawler/pen test/junk traffic coming through on any public domain and Next.js creates a static file for all requests just to serve up a cached 404 response. There does not appear to be any way to configure Next.js to not create these files without hacky middleware. These files grew to 1gb in size in less than a month.

Has anyone else tackled this issue?