I met up with net::ERR_INSUFFICIENT_RESOURCES error when I'm writing a web page which send ajax request to server per second.
I found that even the first dozens of ajax will be pending for a while. Then pending request became more and more until net::ERR_INSUFFICIENT_RESOURCES occurs. Someone says Chrome only allow 6 connections concurrently in one group. I don't know if it's true.
So what's the solution? I think there might be 3 simple solutions for me. 1. Decrease the frequency of Ajax request, waiting 2 or 3 seconds per request for example. 2. Set a number counter in js. Do not send request if it comes to threshold. 3. Put all DOM's ajax in one request.
Are there other common solutions for such a situation? Actually my code is to get real-time information from server, and I think situation of this kind is quite general for monitoring.
Thanks~
Aucun commentaire:
Enregistrer un commentaire