Background Assets: Any limit on number of scheduled downloads?

Is there a design limit on the number of concurrent scheduled downloads?

For my app I want to download as many as 30K items, each of which comes from a separate URL. How can I most efficiently do that using Background Assets?

Should I schedule all 30K URLs at once, or should I schedule in batches, waiting for each batch to complete? (This is usually content the user has specifically requested to be downloaded, is there any way I can indicate that to the OS, to increase the priority?)

The underlying system service will throttle your requests if you send too many. Scheduling 30,000 individual HTTP requests is neither good for your web server nor system performance. I'd recommend packaging what you need to download into a larger combined compressed file, then unpack it on device.

Background Assets was created to support downloading large files in the background before your app is launched, or after it is updated. So that your users are not having to wait for these assets to download when they launch your app. It was not created to download thousands of small individual files.

The throttle ratio is subject to change, currently we have it set at 30. If you try to schedule more than this amount, you'll receive an error back from the API.

/* BAErrorCodeDownloadQueueFull */
"The requested download could not be scheduled because the download queue is full.";

To answer the second part of your question, there is a priority argument on BAURLDownload where you can specify where your scheduled download should be placed into the download queue. https://developer.apple.com/documentation/backgroundassets/baurldownload/4027492-init

Thank you for the quick and thorough response.

It is unfortunate that you are not targeting my use case. Just to give you some insight, my application uses edge caches, where the data is split up into many smaller pieces, that are cached near the users. Different users request different pieces of data. (But there is some overlap between users.)

Think open world MMO data, real-world map tiles, or songs. These are situations where each user wants a different set of data, so it doesn't make sense architecturally to create or download large bundles.

Background Assets: Any limit on number of scheduled downloads?
 
 
Q