Question
Does ConfigModule caching in NestJS interfere with .env updates during development?
Nia Maple
0 reputation · 18 Jan 2020, 09:38 UTC
79K views0
Goal
Establish a repeatable NestJS development environment where environment variables can be adjusted without rebuilding containers or restarting the application.
Uncertainty
The NestJS ConfigModule offers a cache option that stores configuration values after the first load. It is unclear whether enabling this cache prevents changes to .env files from being picked up during hot‑reload development, and whether disabling it introduces performance overhead or inconsistent values across requests.
- Does enabling cache block .env updates when using NestJS hot‑reload (e.g., via nest start --watch)?
- If cache is disabled, does each request incur a measurable performance cost in typical dev workloads?
- What configuration (cache:true/false) aligns best with a repeatable dev setup that uses Docker Compose for service orchestration?