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 8073559
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T14:22:21+00:00 2026-06-05T14:22:21+00:00

I wrote a very simple AJAX chat app with jQuery. It simply sends your

  • 0

I wrote a very simple AJAX chat app with jQuery. It simply sends your message to a PHP file via AJAX, then writes that message JSON-encoded into a text file for the receiver to pick up. The JSON file is simple, like {“userid”:1,”msg”:”hello there”}, and its stored under the receiver’s user ID. Once the receiver detects a timestamp change on the file, it reads the JSON data out of it.

This works well, and it’s very fast. But now I’m considering scaling etc, and I am unsure how filesystem-based chat like this would work long-term. Should I seriously consider an XMPP server and rewrite the Ajax stuff around it, or keep what I have? Thanks in advance.

  • 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-06-05T14:22:23+00:00Added an answer on June 5, 2026 at 2:22 pm

    If scalability is your concern, then I would definitely consider replacing AJAX with XMPP even if your app has no chat capability in it at all. Although XMPP has a lot of complexity in it at the protocol level, Strophe does a great job at abstracting away that complexity. Here is some sample code that does the XMPP equivalent to an AJAX call.

    /**
     * handle the response from the search request
     * @param {Element} retStanza contains the iq result packet
     */
    com.dynamicalsoftware.opeye.admin.Category.prototype.handleSearchResult = function(retStanza) {
        var a = goog.dom.getElement(com.dynamicalsoftware.opeye.admin.appAreaId);
        goog.dom.removeChildren(a);
        var categories = iqresult.getElementsByTagName('category');
        for (i=0; i<categories.length; i++) {
        new com.dynamicalsoftware.opeye.admin.Category(com.dynamicalsoftware.opeye.admin.GuiMode.SEARCHRESULT, categories[i]).render(parentDivTabContent);
        }
    }
    
    /**
     * perform a search operation
     * @private
     */
    com.dynamicalsoftware.opeye.admin.Category.prototype.search = function() {
        var request = $iq({to: 'category@' + com.dynamicalsoftware.opeye.admin.domain, type: 'get'}).c('query', {xmlns: 'http://www.dynamicalsoftware.com/opeye/admin/category'});
        var outstanza = request.tree();
        connection.sendIQ(outstanza, this.handleSearchResult.bind(this));
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to learn Android app development and wrote a very simple app
I have wrote a very simple php upload. But I want to insert image
I just began learning PHP. I've installed php5 on Linux and wrote very simple
I wrote the beginnings of a very simple comment system. It uses jQuery /
I've wrote very simple minification/compression handler that minify css and js by indicating request
I use mechanize gem to crawl websites. I wrote a very simple, one-threaded crawler
I'm trying to use AppWeb, and i wrote a very simple program to embed
I have a very simple little piece of Lua code, which I wrote while
I wrote a simple web app to let user input data as they walk
I wrote a very simple C function to illustrate what I would like 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.