Customizable download behavior
🏗 Enhancement Proposal
This proposal would also need changes to the flutter_cache_manager library.
Right now for downloading images there are 10 max concurrent downloads and everything else gets into a first-in-first-out queue. The cachemanager will download every image the gets requested. I would like to propose to make this behavior customizable:
- customizable number of concurrent downloads
- customizable download queue behavior (e.g. last-in-first-out)
- images that are not needed anymore and are still in the download queue, should be removed from the queue.
Pitch
In many apps you have lists of items containing images and the user scrolls through the list. The app should display the images that are in the visible area as fast as possible. As i understand the code of flutter_cache_manager there is a queue of files to download (web_helper.dart). When the user scrolls the queue gets filled, but as the items might have gotten already irrelevant, because the user scrolled to a new area of the list. Items that have gotten in later are now more relevant. Right now the queue works first-in-first-out. Last-in-first-out would make more sense, be to have this behavior customizable would be even better. I think it would even make sense to remove items from the queue as they went out of the visible area before they got downloaded.