sasha
sasha

Reputation: 821

Jade: Are the template files loaded per npm start?

As in the title said, are the jade template files as is loaded, when I start my app server (e.g. via terminal npm start)?

If so, it would be less CPU consuming to use deeper template hierarchies, I suppose.

Upvotes: 2

Views: 47

Answers (1)

Ash
Ash

Reputation: 6783

View templates are compiled and cached (in production) when requested, not at startup.

To enable template caching when not in production mode you can enable by doing the following:

app.set('view cache', true);

See the Express docs for more information.

Upvotes: 2

Related Questions