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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:50:35+00:00 2026-06-17T23:50:35+00:00

As soon as, I send request to the server (via NSURLConnection sendSynchronousRequest method), the

  • 0

As soon as, I send request to the server (via NSURLConnection sendSynchronousRequest method), the server receives it in about 2 seconds, it processes and sends back response in another 3-5 seconds. However, I only get back the response in 30-35 seconds. This delay makes our communication very slow.

Even the async APIs are getting a delayed response.

Earlier, everything was working fine, with client getting the response back within 10 seconds.
Anyone else having this issue? What could be the reason?

EDIT
here is a screenshot of Wireshark analysis:

Link to a better image

enter image description here

How should I see what packet is saying what?..and why is it getting delayed?

EDIT2
Here is the code:

 NSHTTPURLResponse *response=nil;

NSMutableURLRequest *theRequest=[NSMutableURLRequest requestWithURL:[NSURL URLWithString:nsURL] cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:180.0];
[theRequest setHTTPMethod:@"POST"];
[theRequest setTimeoutInterval:180.0];
[theRequest setHTTPBody:[[NSString stringWithFormat:@"%@",sdata] dataUsingEncoding:NSASCIIStringEncoding]];

NSError *error= nil;

NSData *result = [NSURLConnection sendSynchronousRequest:theRequest returningResponse:&response error:&error];
if (error ) {
    NSLog(@"error sending synchronous request: %@", error);
}
NSLog(@"request completed with code:%d",response.statusCode);
  • 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-17T23:50:36+00:00Added an answer on June 17, 2026 at 11:50 pm

    Solution that worked for me:

    In the request headers, iOS sets “gzip” for “Accept-Encoding” by default. The gzip compression was taking a lot of time, and hence the delayed response. I did the following to solve the problem:

    [theRequest setValue:@"" forHTTPHeaderField:@"Accept-Encoding"];
    

    NOTE: Check your headers, for any response delay.

    Thanks to @occulus for directing me to the request headers!

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

Sidebar

Related Questions

I need to use a GET request to send JSON to my server via
I am trying to send reqeuest to server...and until request is not responded i
No clue how to send an email as soon as an order has been
How soon after the reference count reaches zero is __del__ method called? Does the
When a user clicks a link, I would like to send an AJAX request
I am writing a cgi page in Python. Let's say a client sends request
Is it possible to send an ajax request in onsubmit() of a form? I
I have a flash application that needs to send a http request to the
What is the simplest way to solve the following in WF 4.0: Send data/request
Suppose I make an AJAX HTTP Request from jQuery to a back-end PHP script

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.