Saransh Mohapatra
Saransh Mohapatra

Reputation: 9636

Expressjs without templates

I am looking to develop an web application which is basically one page and I am little confused regarding two things.

What are the advantages and dis-advantages of each of the methods?(speed is a criteria I would value a lot).

You can be descriptive in your answer.

Help me. Thanks.

Upvotes: 0

Views: 103

Answers (1)

Aurélien Thieriot
Aurélien Thieriot

Reputation: 5923

I think the debate is the same for Node.js than for any other tech.

With a classic MVC solution and server side template, all the computation is made server side and pure HTML is sent to the client. The response could take longer but the browser, and the client computer, are not heavily used. It's easiest to maintain if you are not confident in client side Javascript. I think it would be easiest as well for caching.

On the other side, the match up solution, made generally by calling API with Ajax, put more heavy computation on the client browser and leave your server globally alone. You can even think about a full static page for example that populate his content only with JavaScript. You have to be more confident with JavaScript (And use stuff like Angular.js for example). The response will be faster but the user experience will be different from a client point of you. So you will have to put more efforts on the design.

This second solution let you choose another technology for the API. And you will find lots of help for both.

But I would say that neither of those solution are radically faster than the other (Depending of what you do), but it's a matter of the user you have (JavaScript might be better handled in a recent browser) and you confidence in JavaScript.

Though, these days, for a one page website, the trend seems to be in favour of the couple API + Ajax call.

Upvotes: 1

Related Questions