In a site I have a "plus" and "minus" button to change the amount of an item in the cart, only the item is updated and clicked. If the client clicks 10 times in a row, 10 requests are made, and the server takes time to execute all processes and then gives timeout. I need to be able to click as many times as I want on the button to increase the quantity, and then, when I stop clicking, after 2 seconds, update the values, making only one request.
How can I do this?