ASIHTTPRequest download: Should I request a large file or many small files?

I am using the ASIHTTPRequest library for my iOS project. My application is to download an e-book (with over 150 jpg files). I have two options:

  • Freeze all the images and just request one archived file (about 200 MB).
  • Request images for each of them (this will be 150+ requests).

Which option is better if I have more than 1000 users requesting an e-book every day?

+4
source share
1 answer

This is not quite a 100% answer to your question, but based on experience, I believe that you will find it useful.

I made a somewhat similar application, when I had to update (redownload) a very large number of XML files (up to several thousand).

The one-by-one method was pretty slow, but with good NSOperation and NSQueue it worked fine, without the UI freezing or crashing on the first iPad. I believe that for the maximum number of files it took no more than 15-20 minutes (somewhere more than 5000 operations with 5 simultaneous downloads), on a Wi-Fi connection.

When I tried the zip method to find out if it would be faster / better, this caused iPad 1 to crash due to high memory usage. And the zip size was about 100 mega if I remember correctly

I suggest you go to the first option. 1000 requests per day are not such a large number, and therefore the user does not need to wait until the entire archive is downloaded, but he can read the read pages without any problems.

0
source

Source: https://habr.com/ru/post/1435222/


All Articles