Note that there are some explanatory texts on larger screens.

plurals
  1. PODownload speed connection varies - first time takes much longer - why?
    text
    copied!<p>my app needs to download some data (about 50k) on launch time. I'm currently evaluating download speeds under several circumstances, especially slow connection speeds.</p> <p>I have some simple test code shown below. A button starts the download of the file and starts the measurement, the end of the measurement is when the download has finished (all this is running in the main thread btw).</p> <p>The first time I push the button, the time to download is much longer than if I press the button subsequentially (like after 2s). If I wait 10 sec and push again, the time will be longer again.</p> <p>Why is this? Does is cost that much time to make the initial connection? I know the code below is quite primitive. What would be the best way to get a connection quicker.</p> <p>EDIT: I have a assumption that this definitely has to do with the way the ISP/phone company handles the Internet connection. Might it be, that the Internet connection of my ISP is kind of stripped down to a certain minimum when I'm not actively using the network? And then, when I download something, more 'channels' are added for better speed? I checked several SIM cards: the more expensive the data rate is, the more consistent is the behavior. Say, if I use a brand A SIM, if have the behavior described above, if I use brand B (premium), everything is fine.</p> <p>Many thanks in advance</p> <hr> <pre><code>NSURL *url = [NSURL URLWithString:@"http://myServer/testFeed1.zip"]; NSData *urlData = [NSData dataWithContentsOfURL:url]; </code></pre> <p>… save the file</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload