In Express, the environmental variable
NODE_ENV is designed to inform the web application of the execution environment: whether it is in development or in production. Express and Pug automatically modify the defaults of a few options in production environment, to provide a better out-of-the-box experience for users.
To override the defaults for
cache, you can set the respective property in
res.locals objects to
cache option can also be overriden through Express’s
For more details, check Express’s API reference.