Closed febg11 closed 3 years ago
Nope, the cachemanager should only download once. If the download is finished the file should be returned from the cache. If the download is not yet finished the second call should return the file from the first download request. So calling getSingleFile
multiple times is fine.
Hi
I was wondering what the behaviour is with calling
.getSingleFile(webURL);
multiple times with the same url?For example i have a widget in a list view that will call the .getSingleFile(webURL); in the init. This same file could appear multiple times in the list, sometimes often. If the user ends up loading the same url twice in two widgets is the file actually downloaded twice? or does your code block and wait for the first download to complete and then return the cached file.
i''m worried the user could end up downloading the file 10-20 times if they scroll through the list really quickly and initialise lots of widgets with the duplicate urls, completely burning through mobile data and server bandwidth.
Thanks