Hacker News new | ask | show | jobs
by EC1 4507 days ago
What would you use for a public facing application?
3 comments

Any sort of standard server side rendering, or possibly a front end framework that can be rendered server side as well (I think React can do that, same as Backbone).

Basically, SPA frameworks are useful when you are working with lots and lots of data moving back and forth. A good example is something like Intercom.io's interface. They have tons of tables and modals and data flying around. This isn't conducive to the standard browser request -> server render -> load whole new page on the client. It's just too slow. When you're interacting purely with data in a master interface, SPA frameworks are the way to go. And it isn't even a matter of literal page loading and rendering speed, it's the fact that refreshing the view with a whole new page on each link click is a context change that adds up when you're managing a lot of data or performing a lot of small tasks in an application.

But something like Blogger, where you're reading just some content, maybe some comments...there's no real benefit from loading it in a SPA environment. Render it server side, cache it, and fire it to my browser as fast as possible.

> Render it server side, cache it, and fire it to my browser as fast as possible.

Shameless plug, but we've been trying to do something similar with Forge (getforge.com). We built a Javascript library called TurboJS that precompiles a static HTML build into a JS manifest and loads it all. It's SEO-friendly and super-fast. Our other site, http://hammerformac.com/ uses it, for example.

Precompiling static HTML is a strict sub-problem of the problem most people in this comment thread are referring to, which is development incentives and SEO characteristics for web pages that have non-trivial amounts of dynamic content.
I recommend PJAX. It degrades gracefully for search engine indexing.
Yep. PJAX and it's ilk are wonderfully simple, degrade well and fit in with many existing approaches.

We added PJAX rendering to a Django site in under an hour. All the benefits of SPA's and few of the downsides.

I've started using PJAX where the rendered page does not have to change when its source data does, and where you don't have large tables/calendars that would have to be re-rendered when one data value changes.

Development is significantly faster, less error-prone, easier to maintain. Development can also be given to people with lower skill levels.

"node.js + express + jade" is a fairly common stack, you can even try to move an existing complex angular.js code there because it's written in the same language
Is node really a good choice for static non-real time sites? I'm thinking something like Django or Ruby on Rails is better.
Why do you think they are better?

In most cases Node.js is just faster than Rails or Django.