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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T11:37:28+00:00 2026-05-30T11:37:28+00:00

I’m making a chat script using jQuery and JSON, but my hosting suspends it

  • 0

I’m making a chat script using jQuery and JSON, but my hosting suspends it due to ‘resources usage limit’. I want to know if it is possible (and how) to reduce these requests. I read one question in which they tell something about an Ajax timeout, but I’m not very good at Ajax. The code is:

function getOnJSON() {
    var from;
    var to;
    var msg_id;
    var msg_txt;
    var new_chat_string;

    //Getting the data from the JSON file
    $.getJSON("/ajax/end.emu.php", function(data) {
        $.each(data.notif, function(i, data) {
            from = data.from;
            to = data.to;
            msg_id = data.id;
            msg_txt = data.text;
            if ($("#chat_" + from + "").length === 0) {
                $("#boxes").append('...some stuf...');
                $('#' + from + '_form').submit(function(){
                    contactForm = $(this);
                    valor = $(this + 'input:text').val();
                    destinatary = $(this + 'input[type=hidden]').val();
                    reponse_id = destinatary + "_input";
                    if (!$(this + 'input:text').val()) {
                        return false;
                    }
                    else {
                        $.ajax({
                            url: "/ajax/end.emu.php?ajax=true",
                            type: contactForm.attr('method'),
                            data: contactForm.serialize(),
                            success: function(data){
                                responsed = $.trim(data);
                                if (responsed != "success") {
                                    alert("An error occured while posting your message");
                                }
                                else {
                                    $('#' + reponse_id).val("");
                                }
                            }
                        });
                        return false;
                    }
                });

                $('#' + from + '_txt').jScrollPane({
                    stickToBottom: true,
                    maintainPosition: true

                });
                $('body').append('<embed src="http://cdn.live-pin.com/assets/pling.mp3" autostart="true" hidden="true" loop="false">');
            }
            else {
                var pane2api = $('#' + from + '_txt').data('jsp');
                var originalContent = pane2api.getContentPane().html();
                pane2api.getContentPane().append('<li id="' + msg_id + '_txt_msg" class="chat_txt_msg">' + msg_txt + '</li>');
                pane2api.reinitialise();
                pane2api.scrollToBottom();
                $('embed').remove();
                $('body').append('<embed src="http://cdn.live-pin.com/assets/pling.mp3" autostart="true" hidden="true" loop="false">');
            }
        });
    });
}

The limit is of 600 reqs/5 min, and I need to make it almost each second. I had a year already paid and they have no refund, also I can’t modify the server, just have access to cPanel.

  • 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-30T11:37:30+00:00Added an answer on May 30, 2026 at 11:37 am

    Well, 600 req/5 min is pretty restrictive if you want to make a request/sec for each user. Essentially, that gives you that each user will make 60 req/min. Or 300/5 min. In other words, even if you optimize your script to combine the two requests to one, at maximum you can have two users at your site 😉 Not much I guess…

    You have two options:

    1. Stick with making a chat system through Ajax requests and change the hosting provider. This might be actually cheaper if you don’t have the skills to do 2.

    2. Forget about making an Ajax request to poll and potentially another to push every second. Implement something around web sockets, long-polling or even XMPP.
      If you go that route, I would look at socket.io for a transparent library that uses web sockets where they are supported and has fallbacks to long polling and others for the rest. For the XMPP-way, there is the excellent Strophe.js. Note that both routes are much more complex than your Ajax requests and will require a lot of server logic changes.

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

Sidebar

Related Questions

I want to count how many characters a certain string has in PHP, but
I have a French site that I want to parse, but am running into
I am reading a book about Javascript and jQuery and using one of the
I want to construct a data frame in an Rcpp function, but when I
I'm making a simple page using Google Maps API 3. My first. One marker
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a jquery bug and I've been looking for hours now, I can't
Seemingly simple, but I cannot find anything relevant on the web. What is the
I want use html5's new tag to play a wav file (currently only supported

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.