Answer the question
In order to leave comments, you need to log in
Pre-compilation of templates in the client-side application - is it necessary?
We are talking about compiling templates on the server, at the deployment stage, or immediately before giving the statics to the browser.
Why I had doubts is that compiled templates are clearly larger than uncompiled ones (for devices with poor internet, this is critical), and any decent template engine caches once compiled anyway (and even if not, this is trivial to do at the application level).
Answer the question
In order to leave comments, you need to log in
Do not forget about gzip, it will shake everything for you very cheerfully. And compiling on the client is not very good.
Need of course, but how without it? If this client does not compile templates for all users of the site, then it will make a dozen templates at a time without problems. Template engines are very fast, even SmartyJS. After all, that's the point of templates. Moreover, after one compilation, if the template is used constantly, it will no longer have to be compiled. Just do not compile everything at once, but only when necessary.
You can not only compile, but, for example, cut out spaces, and they often make up half of the template.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question