5

I am thinking of adopting on-demand resources in one of my apps. It will contain about 30 videos which most users will only view once. So, it seems like a good candidate for on-demand resources. The lifespan of this app is expected to be about a week so it is good if the system will purge its assets after the user is done with it and forgets to delete it.

However, I obviously want to keep some assets available when the app is still being used. According to the official documentation:

An asset pack is eligible for purging when all of the associated tags are no longer retained by any request. The resources associated with a tag may remain on the device for some time before it is purged, including across app launches.

This description is extremely vague as it doesn't give enough hints as to when the assets can be purged after they are downloaded. Does it happen only when the device is low on memory? Or will the system try to always optimise available memory even if the device has a lot of free space?

I would be really grateful if someone could tell which of the above is correct from their experience. In the case of my app the above uncertainty can lead to two scenarios:

1) Some videos will be purged for users running low on memory. This is great, because those users wouldn't be able to download the app if I bundled all videos with the app, so this inconvenience is totally tolerable.

2) A user who has 64GB of free space on their 128GB device will lose access to some videos and will have to download them again. This would result in ODR performing worse then simply bundling all videos together and I would like to avoid this scenario.

I watched the WWDC video about ODRs, but it also doesn't give an answer to the above question...

Andriy Gordiychuk
  • 6,163
  • 1
  • 24
  • 59

0 Answers0