So did you actually try it with the 2 second timeout in the ajax request? My guess is there are a whole bunch sockets being held open by the PC, and it's those open sockets that are blocking everything else until they finally time out.
If the ESP8266 gets overwhelmed, you want the AJAX request to fail as soon as possible - then you can just try again later (you could even detect it and decrease the speed at which you issue requests). It might even be worth setting the timeout even lower than 2s.
If you close all the webpages and restart them, does the server spring back into life faster? That would help to narrow it down.
Also, what about the WebSocket suggestion?
But how the server knows when to do that since everything seems fine on that side?
Yeah, I have no idea - short of just seeing if you have no requests for a while. If you do find a way, you might find that closing the server and re-opening it solves everything, and is much faster than restarting the ESP8266.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
So did you actually try it with the 2 second timeout in the ajax request? My guess is there are a whole bunch sockets being held open by the PC, and it's those open sockets that are blocking everything else until they finally time out.
If the ESP8266 gets overwhelmed, you want the AJAX request to fail as soon as possible - then you can just try again later (you could even detect it and decrease the speed at which you issue requests). It might even be worth setting the timeout even lower than 2s.
If you close all the webpages and restart them, does the server spring back into life faster? That would help to narrow it down.
Also, what about the WebSocket suggestion?
Yeah, I have no idea - short of just seeing if you have no requests for a while. If you do find a way, you might find that closing the server and re-opening it solves everything, and is much faster than restarting the ESP8266.