I own multiple game servers as well as a website to display the server status.
The problem is that the website (server status page) is slow as it needs to ping/fetch data from a remote IP every single time the page is load.
I’ve seen other places do this such as here where they use dynamic JSON (here) to fetch the server status.
The one shown above seems to load instantly and I am wondering how exactly this can be achieved?
Basically, I want to fetch the server status without it causing major lag every time it wants to load it (preferably similar to the one above simply because it works well).
I have been looking and timing the example you have posted (with a biased mind, I admit).
I think (and thought before testing): they have some code running on the server that generates this data every 2 seconds. This simply means every time you call the json-script, the site simply returns the data that already exist (like ping).
They might even log all this data, so the json ping call simply returns the last entry. That should give an almost instant answer and predictable loadtime and it is how I would do it.
Good Luck!