Hi,
First of all, thanks for all the hard work, nunjucks is a great tool.
I have a question however, please forgive me if it sounds dumb, I couldn't find
a satisfying answer in the documentation / github issues.
Should I / can I use nunjucks precompilation for a production nodejs/express app ?
(I think this question is a good candidate for the FAQ btw)
If so, should I compile my templates on the app startup or in the build phase ?
How does this change the way I declare the use of nunjucks templates in my app?
Thanks,
Tim
There's not really a need to -- on the server, nunjucks will cache the compiled template the first time it's used by default.
The main usage for this is client-side templates, because it allows a slimmer nunjucks build to be sent down to the client and less work for the browser.
Makes sense, thank you.
@ziir @devoidfury Thank you for your q&a 馃槀
Most helpful comment
There's not really a need to -- on the server, nunjucks will cache the compiled template the first time it's used by default.
The main usage for this is client-side templates, because it allows a slimmer nunjucks build to be sent down to the client and less work for the browser.