Skip to content

Instantly share code, notes, and snippets.

@obrodinho
obrodinho / README.md
Last active May 3, 2020 21:15
Executing simultaneous ajax requests in a chunk-based order. Slicing demand and deferring execution [jQuery][AJAX]

Slincing huge amount of requests in chunks and Deferring jQuery AJAX requests to execute a chunk at time.

Let's say, that you have a ton of ajax requests to do (what's not recomended) and parallelize all requests may turn your server unstable and your screen blocked.

In this gist I document a solution that I used to preserve the server's sake and alleviate page loading.

Scenario

So, we have elements that holds an attribute (data-async-url) that prior this kludgy solution was used by the jquery plugin async-include by Mr. Peter Coles. BTW, Thanks, Peter!