I am thinking about using resources on demand in one of my applications. It will contain about 30 videos that most users will watch only once. Thus, he seems to be a good candidate for resources on demand. The life of this application is expected to be about a week, so it’s good if the system cleans its assets after the user performs this action and forgets to delete it.
However, I obviously want some assets to be available when the application is still in use. According to official documentation :
An asset bundle can be cleared if all related tags are no longer stored at any request. The resources associated with the tag may remain on the device for some time until it is cleared, including launching applications.
This description is extremely vague because it does not give sufficient hints as to when the assets can be cleaned after they are loaded. Does this only happen if the device has insufficient memory? Or will the system always try to optimize the available memory, even if the device has a lot of free space?
I would be very grateful if anyone could say which of the above questions are true from their experience. In the case of my application, the above uncertainty can lead to two scenarios:
1) Some videos will be cleaned up for low memory users. This is great because these users will not be able to download the application if I linked all the videos to the application, so this inconvenience is quite bearable.
2) A user who has 64 GB of free space on his 128 GB device will lose access to some videos and will have to download them again. This will make ODR work worse than just merging all the videos together, and I would like to avoid this scenario.
I watched a WWDC video about ODR , but it also does not provide an answer to the above question ...
source
share