I'm a beginner in PHP and making a website that displays basic system information(CPU usage, memory usage etc)of a linux system on a webpage.For the web server, i used the built-in web server:
php -S 192.168.1.36:8000
The frontend uses Bootstrap and JS. The php script i'm using uses Server-Sent Events(learnt about it from here) to send CPU usage, memory usage and disk usage(it gets those from the shell_exec() method) to the front-end approximately once every 2 seconds.
The problem is, the site is very slow to refresh, and occasionally, very slow to load the first time too. When i looked at the JS console, i noticed that the server was streaming data to the webpage even after i pressed the refresh button.Could it be because the connection hasn't been closed??