Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6790433
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:43:29+00:00 2026-05-26T17:43:29+00:00

I already asked a similar question but this one is a bit different/specific: I’m

  • 0

I already asked a similar question but this one is a bit different/specific:

I’m about to start development of a social community site (for a local user group) with features like timeline, IM/chat, forums, …

Node.js and socket.io (or now.js) on the backend. jQuery (and maybe backbone.js or similar) on the front end. Content is loaded via socket.io or ajax and navigation via url hash.

There are 2 things where I just can’t decide which way to go. I hope here are some people who can provide some good or bad experience.

  1. Templating on server or in browser? I’m not sure if it’s better to load a complete html site + live updates (also in html) for timeline, forum posts, IM/chat, … or use something like a REST api via ajax or socket.io and do the templating on the client site. I’ve never done that before. You need to download the templates, etc, etc. Has anyone experience in this? There are also 2 ways to implement a rest-like api: E.g. request a forum post, then request the user associated to that post and so on (just like server side MVC) – or – request a forum post and the server answers with all needed information.

  2. Load content via ajax or socket.io? I’m definitively using socket.io or now.js for real-time communication (IM, chat) and pubsub (on mainpage -> subscribe to new timeline updates, on a forum topic -> subscribe to new posts). But should I also load HTML (or provide a REST-like API, see question 1) through the socket? When people open forum posts in tabs (which I usually do a lot) that would mean a lot of socket connections. And I’m not sure how long it takes for a websocket to establish connection.

So there a 4 ways to do this:

  1. HTML via AJAX – probably the most stable way that doesn’t need a lot javascript to do the templating – Browser can use open HTTP connections to request stuff.
  2. HTML via socket.io – The websocket must be established to load content (may be slower)
  3. API via AJAX – as it probably needs more requests as HTML via AJAX there might be some HTTP header overhead + you need to authentication in each request- I’m not a friend of too many ajax requests.
  4. API via socket.io – Socket must only be authenticated only once and you can request API objects on the fly. However I would still load templates and js via HTTP for browser caching.

I know this is a huge post but I’m debating for many days now and just can’t decide as it would be a lot of work to switch the system once started developing. This is not a public project, it’s limited to ~10k-15k local people and thus must not be that perfect, a good opportunity to learn new things in my opinion (I’m completely new to node, classic PHP MVC + jquery dev here).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T17:43:30+00:00Added an answer on May 26, 2026 at 5:43 pm

    I think you should use a RESTful api on the backend, let the templating occur just on the frontend (maybe with Backbone) and only use Socket.IO for real realtime stuff (such as chat). It doesn’t make any sense to use websockets for something like loading HTML, because it most likely never changes.

    So my vote is:

    1) HTML via AJAX
    2) API via AJAX
    3) Realtime communication, such as chat messaging (or other stuff that constantly changes) via Socket.IO

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know this is a similar question to one already asked, but I was
I've already asked similar question on this issue on stack overflow already, but I
I already asked a similar question, PE Header requirements , but I'm not really
This is similar to a question that has already been asked. However, I am
I already asked this question at the JOS-.NET board but Joel is closing that
I know a question like this was already asked, but the situation is a
I am sorry I have already asked this question on Superuser, but nobody answers
Searching here I found that this question was already asked , but I think
I have already asked a similar question earlier but I have notcied that I
Ok, so I've asked a similar question already, but I'm now faced with a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.