This is THE MOST noobish question ever, I see it done so often.
I want a PHP page which is constantly runnng in the background (the backend) to occasionally query the frontend with updated data. YES, this is the way I want to do it.
But the only way I know of querying a page is to re-create that php, with XHR – so, I would XHR “index.php?data=newdata”, but this would create a new process server-side. What do I do?
(Please ask for more info or correct me if there is a better way of doing it)
COMET may be a way to go; however, having a finalized HTML page, and doing AJAX requests to get updates is the usual, and more robust way to do this. I would investigate ways to implement an Ajax based approached that is optimized for speed.
You say you are doing complex calculations, which you would have to repeat for each request when going the Ajax way. You may be able to help that e.g. by employing smart caching. If you write the results of whatever you do as JSON encoded data into a text file, you can fetch that with almost no overhead at all.