Commit Graph

1 Commits

Author SHA1 Message Date
Jiachi Liu 0a45e33848 [perf] cache load config results (#80570)
This PR is a perf improvement that we only need to load Next.js config once per process. For config schema validation we also only execute once. I noticed that config-schema is executed 3 times, in the 1st root process, and twice when the router-server load configs.

* For `loadConfig` it needs module loading, config parsing, save the expensive effort to only execute once
* Always validate config schema if possible and don't be silent, but only do it once is the parent process. We use `process.send` to check if it's in the root or forked process.
2025-07-25 10:43:18 +02:00