Looks like something that can be solved by moving the task to background with [web workers][0].
[0]: https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers...
[0]: https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers...
Edit: As with everything related to complex web applications (and I had two or three in my career), it is obvious that the whole environment (client, protocols, languages,...) was never designed for this.