From the course: Advanced Express

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Tuning Express performance: NODE_ENV and compression

Tuning Express performance: NODE_ENV and compression

From the course: Advanced Express

Start my 1-month free trial

Tuning Express performance: NODE_ENV and compression

- [Narrator] As soon as your application is deployed to server and available to for real users performance becomes key, and this not only about the user experience of individual users, but also cost effective, because inefficient code needs more resources to run, which forces you to scale up or out. The suggestions in this video are loosely based on the performance based practices from the Express website. We will implement some of them in this chapter, or I will at least explain them. The environment varietal NODE_ENV, is not just a convention to use to distinguish between different configurations in your code. It is also used by Express to make assumptions when it comes to caching and login. For instance when running in development, templates are not cached, but compiled for each execution, which makes sense, because this lets you work on a template, and seeing the changes without restarting the app every time. Of course this comes with a performance penalty and my test indicate…

Contents