Forum Discussion
VikasB
Boss
luk Nice points.
You can use async: false instead of delay parameter. Next call to the endpoint would not be trigger until first call's response comes at the component. It would be more efficient and reliable.
for (var i=0; i<10;i++) { $.ajaxQueue({ url: 'https://httpbin.org/get', async: false,
data: {} }).done(function(data) { console.log('success'); console.log(data); }).fail(function() { console.log('failed'); }); }
luk
8 years agoBoss
VikasB yeah, but async (afaik) is mainly about "outsourcing" the AJAX calls to background tasks, e.g .make them non-UI-blocking, has nothing to do with throttling the requests, e.g. you will still overwhelm the server and trigger a 429 Error when async is set to false, delay is about dealing with rate limits, e.g. for OPs problem that is what is needed to not trigger the Firewall... DougS for that purpose it would be interesting what the rate limit is for endpoints?
Related Content
- 2 years ago
- 2 years ago
- 9 months ago
- 2 years ago