I am new to Node.js and EJS. "Static Caching of Intermediate JavaScript" is mentioned as one of the features of EJS.Can anybody explain what it exactly means.
Regards, Kar
Let's say you have a template, like so:
<h1><%= name %></h1>
Internally, this will compile to something along these lines (very simplified):
function(params) {
return '<h1>' + params.name + '</h1>';
}
That javascript function is really fast to execute, compared to parsing the template over and over again. EJS will cache the function internally, if you call it with the cache
option. Thus, it will not have to compile the template each time it is rendered.