javascript - ajax long polling, what is the maximum number of pages that can be used?
伊谢尔伦
伊谢尔伦 2017-05-16 12:58:29
0
5
465

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?

伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

reply all(5)
phpcn_u1582

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template