Should I be rendering html on the server-side or client-side? Should I be rendering html on the server-side or client-side? express express

Should I be rendering html on the server-side or client-side?


The typical way of using Backbone is to do things client-side. You use client-side template rendering to bind model values to your small view templates. It is an approach to turning HTML/JS into a application development platform with an actual component model.

BUT, that doesn't mean that you can't or shouldn't mix your worlds.

For example, I use Backbone with Rails. My Rails view renders server-side HTML which includes Backbone logic/views. Then, all of my AJAX-style view rendering happens using Backbone with models, views and templates and the models talk to JSON services that live in the Rails backend. The user doesn't see a page load until they need to leave the page to do something else. The experience is quite nice.

You can certainly take that example and render your templates server-side. I wouldn't go as far as to render every instance of the template server-side because templating engines (including the one built into Backbone/Underscore) are so powerful. But, if you wanted to seed your templates with server-side rendering, I could see how that might be useful.