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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T17:45:00+00:00 2026-06-12T17:45:00+00:00

I have this ajax call executing from client side, with jQuery, but at times,

  • 0

I have this ajax call executing from client side, with jQuery, but at times, (I mean generally at the very first call) it is executing very slow, perhaps this figure will explain..

enter image description here

As you can see, the last call is waiting 609ms before anything, though it took 210ms to receive data, that’s bearable, but why the wait of 609ms?

Fiddler’s statistics are

Request Count:   1
Bytes Sent:      552        (headers:543; body:9)
Bytes Received:  364        (headers:234; body:130)

ACTUAL PERFORMANCE
--------------
ClientConnected:    15:16:42.799
ClientBeginRequest: 15:16:42.799
GotRequestHeaders:  15:16:42.799
ClientDoneRequest:  15:16:42.799
Determine Gateway:  0ms
DNS Lookup:         0ms
TCP/IP Connect:     0ms
HTTPS Handshake:    0ms
ServerConnected:    15:16:42.799
FiddlerBeginRequest:15:16:42.799
ServerGotRequest:   15:16:43.408
ServerBeginResponse:15:16:43.408
GotResponseHeaders: 15:16:43.408
ServerDoneResponse: 15:16:43.408
ClientBeginResponse:15:16:43.408
ClientDoneResponse: 15:16:43.705

The jQuery is nothing special, just a simple ajax call…

$.ajax({
        url: '/AutoComplete.asmx/GetPriorityAndRemarks',
        type: 'POST',
        timeout: 20000,
        datatype: 'xml',
        cache: false,
        data: 'arg=' + custCode,
        success: function (response) {
            var result = $(response).find("string").text();
            // the values is in form of name, address, mobile, priority and remark, and discount
            var resultAry = result.split(':');
            //alert(resultAry);
            $('#txtCustomerName').val(resultAry[0].trim());
            $('#lblAddress').text(resultAry[1]);
            $('#lblMobileNo').text(resultAry[2]);
            $('#lblPriority').text(resultAry[3]);
            $('#lblRemarks').text(resultAry[4]);
            $('#txtDiscount').val(resultAry[5]);
            $('#txtQty').focus();
            $('#txtQty').select();
            $('#hdnCustCode').val(custCode);
            return false;
        },
        error: function (response) {
             alert('some error occured');
        }
    });

The code is implemented as

public string GetPriorityAndRemarks(string arg)
{
    try
    {
        SqlCommand cmd = new SqlCommand();

        cmd.CommandText = "sp_NewBooking";
        cmd.CommandType = CommandType.StoredProcedure;
        cmd.Parameters.AddWithValue("@BranchId", Globals.BranchID);
        cmd.Parameters.AddWithValue("@CustCode", arg);
        cmd.Parameters.AddWithValue("@Flag", 31);
        return PrjClass.ExecuteScalar(cmd);
    }
    catch (Exception)
    {
        return "";
    }
}

So, what’s causing it to taking so much time? Also, as a added measure, thinking that calling this code the first time might be slow, I called this code with dummy argument at page load just so that when code gets called with real data, it’s not the first time and any thing regarding server being set up, caching or whatever is already done. But still no luck, the call regardless of weather I call this code with dummy data at page load or not, is always slow when making first call. Can anyone explain to me why is this happening this way?

  • 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-12T17:45:02+00:00Added an answer on June 12, 2026 at 5:45 pm

    This isn’t Firefox waiting before to send the request but Firefox waiting before the server starts pushing data on the socket back.

    See here : Firefox is “Waiting For Response – waiting for a response from the server”.

    The problem is thus only server related (and yes, 609ms to handle a request is terrible). Profile your “asmx” page to see what happens. Maybe you’re doing a bad SQL query for your autocomplete or the database is poorly indexed.

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

Sidebar

Related Questions

On my main page I have this jquery code which does an ajax call
I have a jQuery AJAX call with type:'GET' like this: $.ajax({type:'GET',url:'/createUser',data:userId=12345&userName=test, success:function(data){ alert('successful'); }
I have a web service that returns this string via the jQuery $.ajax() call
A situation I ran across this week: we have a jQuery Ajax call that
I have this jquery call to ajax, function findTaxForProcess(argPrc, argPrcAmount, argPrcDiscount) { if (argPrc
I have the following ajax call var prev_sibling = $(this).prev().attr(value); var next_sibling = $(this).next().attr(value);
I have this AJAX submission form written with the jQuery validation plugin. It all
I have this AJAX code, but it doesn't seem to throw the 'alert' method.
I have this ajax jquery code: var form = document.getElementById('frm'); var data_string = form.serialize();
I have this AJAX loader, created using CSS. And I m trying to increase

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.