F
F
FullTwo2019-04-11 11:15:37
AJAX
FullTwo, 2019-04-11 11:15:37

Mysqli + ajax request queue, implementation via response?

Good time of the day!
There was such a problem:
Through ajax, I set auto-update every 1 second from update requests, when there is 1 person on the resource, the server behaves quite normally, and when more than 3, a queue of requests is created that can be processed from 1 second (first request) to 1 minute (last request) ....
How can this be optimized or made sending a second request only when the answer came
PS I write in PHP

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stepanya, 2017-02-11
@Stepanya

let id = 0;
const todoList = [];

function addNewToDo(data) {
  todoList.push({id: id++, index: todoList.lenght,data: data});
}

function remove(todo) {
delete todoList[todo.index];

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question