E
E
Evgeny Nikolaev2017-04-10 05:41:54
Node.js
Evgeny Nikolaev, 2017-04-10 05:41:54

How to fix Long Pulling?

The bottom line is this:
I am writing a WEB application using NodeJS in conjunction with AngularJS.
The problem is, I send an Ajax request to the server, and it is stored there (on the server) until some action is performed (it may not be known how long it takes), and if I leave the page where the request is sent, and then I return again, then the request sent again. But the old request is still stored on the server. And, accordingly, when performing the action I need, an event handler is triggered that repeatedly sends a response (many times - the number of page updates, that is, sending a request), of which only one is needed. So, how can you get rid of all the unnecessary requests that are stored on the server? I hope I explained clearly.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaly, 2017-04-10
@khveugen_27

In general, it’s worth getting away from long pool and long requests
. But if it’s not about a long-running request, but about a request that comes softly, it’s better to look towards sockets

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question