tonyofrancis / Fetch

The best file downloader library for Android
https://www.meta.stackoverflow.com/tags/fetch2
Apache License 2.0
1.63k stars 328 forks source link

Parallel Download type causes to increase the network usage about five times more than what it is #651

Open imansdn opened 1 year ago

imansdn commented 1 year ago

recently users reported to us that the Application is consuming their data traffic excessively, after investigating and measuring it multiple times we found out this is causing due to this config:

 FetchConfiguration.Builder(context)
            .setDownloadConcurrentLimit(DOWNLOAD_CONCURRENT_LIMIT)
            .setProgressReportingInterval(PROGRESS_REPORTING_INTERVAL)
            .enableRetryOnNetworkGain(true)
            .setAutoRetryMaxAttempts(AUTO_RETRY_MAX_ATTEMPT)
            .enableAutoStart(true).setHttpDownloader(
                OkHttpDownloader(
                    okHttpClient,
                    Downloader.FileDownloaderType.PARALLEL
                )
            ).build()

Finally, I figured out that removing the Downloader.FileDownloaderType.PARALLEL from the okHttp config resolves the issue.

consuming the network data about 5 times more than the actual size is an important issue and I hope to see the fix in the next versions.

Cheers!