How to update the progress bar during a long cycle?

How to update progress bar (html) during a long cycle (php-database export / import mysqli)

I don’t want to use a file or database to store temporary values ​​or the progression of the cycle, since this causes too many IOs to be used (and in the case of a file-based solution, the client often stops reading the file before the data has been written)

I looked at an event type situation, however, output buffering takes too much time to refresh the display.

Secondly, I looked at some of the methods that others have imposed on JavaScript markup in the browser, but this ends up with too much HTML being output (aka, 1,000,000 + records that are unloaded).

Basically, I am open to fresh ideas on how I can update the progress bar in a web browser, while in fact a very lengthy process is taking place in PHP (this is not upload file - I understand that there are extensions for PHP that allow for progress, however, it seems nothing happens to achieve progress in the server loop).

Any ideas? --- I really do not want to deviate from PHP / JavaScript / HTML to other platforms such as node.js / cocoa / etc.

+4
source share
1 answer
+1

Source: https://habr.com/ru/post/1536267/


All Articles