Yes, both of those options make sense.
There are lots of different COMET-style techniques, but one of the simplest is a long-running iframe
. You have a PHP page that monitors the progress of the operation, and outputs something like this at regular intervals:
<script>parent.updateProgress(relevantUpdateInfo);</script>
...where relevantUpdateInfo
is the information about the progress, and updateProgress
is a global function on the page containing the iframe
that shows the updated information in the UI.
When outputting the script
tags, be sure to flush
the output.