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

  • SEARCH
  • Home
  • 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 4589786
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T22:08:18+00:00 2026-05-21T22:08:18+00:00

Lets say I want to write an AJAX chat box, just something simple, I

  • 0

Lets say I want to write an AJAX chat box, just something simple, I write some text, and it gets posted up. Lets not even worry too much about names of users in the box.

First instincts tell me to just write a table and post data into it, and query every few seconds.

Lets pretend this isn’t 2011 and computers a cheap and we’re okay with slow laggy chat boxes that update every 5 seconds, or slow the entire server down with a storm of SQL.

What are some alternatives? Could I do something with XMPP? What if I didn’t have anything other than my favorite server-side language (and some SQL)? Could I use message hashes in some neat way? What can I do to limit the number of requests?

What I’m looking for is a great plan for writing the software behind a web-based chat box, that is very resource efficient, and flexible. I’m sure we’re doing something neat here on SO for the chatrooms we already have.

  • 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-21T22:08:19+00:00Added an answer on May 21, 2026 at 10:08 pm

    Your problem is you’re polling every now and then. What you really want is a constant connection to stream data with.

    You could try using the Comet method – a streaming connection you can keep open to send chat messages down.

    There’s also a trick called long-polling – You keep the connection open until you receive a new message, then close it and start a new one.

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

Sidebar

Related Questions

Lets say I have some raster data I want to write to a file..
Lets say you want to write a high performance method which processes a large
I have some values that I want to write in a text file with
Let's say I want to write a regular expression to change all <abc> ,
So, let's say I want to write a class that operates on different kinds
Lets say you want to create a listing of widgets The Widget Manufacturers all
My simplified and contrived example is the following:- Lets say that I want to
Lets say I've got two interchangeable pieces of code and I want to figure
Lets say I have a single object of type Car which I want to
I have m2m field, lets say it have name 'relations', so i want to

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.