Julius
12/08/2023, 5:13 AMonDownload
as described in the documentation here: https://ktor.io/docs/response.html#raw
I have this code:
httpClient.get(url) {
onDownload { bytesSentTotal: Long, contentLength: Long ->
println("Downloaded $bytesSentTotal bytes out of $contentLength at time ${Clock.System.now()}")
}
}
In the browser, this first downloads the whole file and emits all the console logs at once after the download has already finished.
I'm attaching part of the log to show how all the logs were emitted in less than a seconds while the actual download of the file took more than 7 seconds.
Is there something I'm doing wrong here or another fix to this?
I'm using ktor version 2.3.7
Edit: I seem to be able to replicate this issue on jvm as well 👀
🎉 Found the cause, it was the ktor HttpCache
plugin!
Should I open an issue for this?Aleksei Tirman [JB]
12/08/2023, 9:18 AM