ejs icon indicating copy to clipboard operation
ejs copied to clipboard

Are EJS templates auto-compiled?

Open matthew-dean opened this issue 11 years ago • 2 comments

One thing that's not clear to me from the documentation. Do you have to run the compile method to benefit from compiling / caching in Node, or is template compilation something that happens automatically? (Automatic would be a preference, of course.)

That is: the list of options doesn't make it clear which are the default settings.

matthew-dean avatar Jun 07 '14 17:06 matthew-dean

From my experience they are not cached without manual compilation. We noticed a significant performance boost when we compiled the view once at startup instead of reading the view from disc every request.

ablankenship10 avatar Oct 07 '14 18:10 ablankenship10

.compile() is not cached automatically. Ever. If you are using .render*() it is automatically cached when the cache option is enabled.

TimothyGu avatar Jan 24 '15 20:01 TimothyGu