NODE_ENV not set to production causes 3x performance degradation
warningconfigurationUpdated Feb 6, 2026(via Exa)
Sources
Technologies:
How to detect:
When NODE_ENV is not set to 'production', Express does not cache view templates or CSS files, generates verbose error messages, and runs significantly slower. Tests show this can degrade performance by a factor of three.
Recommended action:
Set NODE_ENV=production using your OS init system. With systemd, add 'Environment=NODE_ENV=production' in the unit file. Verify with process.env.NODE_ENV checks, but do so sparingly as environment variable checks incur performance penalties.