Pre-compile templates with client-side application — do we need it?
We are talking about compiling templates on the server under deployment or directly in front of the static content to the browser.
Why I had doubts — compiled templates are obviously larger than the uncompiled (for devices with poor Internet it's critical), but any decent template engine and so caches once compilenode (and even if not, it trevelino to do at the application level).
4 answers
Don't forget about gzip, it very vigorously you shake. And to compile on the client as it is not very good.
You need a course, and how without it? If this client does not compile templates to all users of the site, a dozen templates over time, it will make no problems. Template engines work very quickly, even SmartyJS. Indeed, in this sense templates. Especially after a single compilation if a template is used constantly, it will not have to compile. Just don't compile all at once, but only out of necessity.
You can not only compile, but for example cut gaps, and they often make up half of the template.
Then a few strange question. Where does the compiling on the server and Javascript, or use server-side JS?
Find more questions by tags Client side optimizationJavaScriptHandlebars
Why? - savannah_Emmerich12 commented on October 3rd 19 at 02:52
20 KB is not so little on EDGE or even GPRS. - savannah_Emmerich12 commented on October 3rd 19 at 02:58