title: NSURLConnection very long downloading
body: <p>I'm facing problem with downloading 5 MB file, it taking more then 2 minutes on iPhone 5 with iOS 6.1. </p>
  
  <p>Using iPhone 4S with same iOS version it taking only 10 seconds, both are using WiFi. </p>
  
  <p>I have tried different cache Policy and timeout Interval of NSURLRequest, it changed nothing, it's still taking long time. Download is over HTTP.</p>
  
  <p>I'm using <strong>NSURLConnection</strong> class, before downloading this "big" file I'm downloading two others. </p>
  
  <p>Don't know what else can be important,to reduce the time.</p>
  
  <p>Thanks in advance.</p>
  
  <p>Code:</p>
  
  <pre><code>@interface MyClass : NSObject &lt;NSURLConnectionDelegate&gt;
  {
    @private id delegate;
    NSURLConnection *connection;
    NSMutableData* responseData;
    //...
  }
  
  
  #import "MyClass.h"
  
  @implementation MyClass
  
  -(void)getObj1:(id)delegateObj
  {
     delegate = delegateObj;
  
     NSString *url = @"...";
  
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:url] cachePolicy:NSURLRequestReloadIgnoringLocalAndRemoteCacheData timeoutInterval:120.0];
  
     connection = [[NSURLConnection alloc] initWithRequest:request delegate:self];
  
     if(connection)
     {
        responseData = [NSMutableData data];
     }
  }
  
  -(void)getObj2:(*String)somesString
  {
  
     NSString *url = @"...";
  
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:url] cachePolicy:NSURLRequestReloadIgnoringLocalAndRemoteCacheData timeoutInterval:120.0];
  
     connection = [[NSURLConnection alloc] initWithRequest:request delegate:self];
  
     if(connection)
     {
      responseData = [NSMutableData data];
     }
  }
  
  -(void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
  { 
      //....
  }
  
  
  -(void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
  {
     [responseData appendData:data];
  }
  
  - (void)connectionDidFinishLoading:(NSURLConnection *)connection
  {
     if(firstRequest)
     {
        //save data from first request and set responseData clear
        [self getObj2:@"..."];
     }
  }
  </code></pre>
  
  <p>and others without anything special, I hope this will be enough</p>
  
  <p>I have found this post <a href="https://devforums.apple.com/message/754875#754875" rel="noreferrer">https://devforums.apple.com/message/754875#754875</a> but still doesn't work fine for me. However now I better understand this strange situation.</p>