The project requires real-time interactive viewing of customer order status.
The current page already has an ajax long polling, responsible for checking whether there are new orders.
Now there is a need to do one to see if there is new feedback... .
After I turned off polling, I found that it was no longer stuck.
Now I need to do two, will it crash directly?
The current long polling of the page is executed after the page is loaded, which makes the page seem to have been loaded forever.
It keeps turning on the title.
Do I need to add a setTimeout() to it?
Since there is Ajax, change your method into an interface and get one or two or more results based on the passed parameters, so there is no need to initiate multiple requests
The previously launched websocket protocol can meet your requirements and is also based on http.
https://socket.io/ recommends you one.
考虑一下websocket
html5 SSE (EventSource) server pushes to the client in real time, simpler than websocket
It depends on how many seconds you request it