tj / ejs

Embedded JavaScript templates for node
4.47k stars 512 forks source link

Are EJS templates auto-compiled? #179

Open matthew-dean opened 10 years ago

matthew-dean commented 10 years ago

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.

ablankenship10 commented 10 years ago

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.

TimothyGu commented 9 years ago

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