Synchronous vs. asynchronous
HTTP requests can be made in two ways; synchronously and asynchronously.
A synchronous request is a blocking request, where everything has to be done in an orderly fashion, one step after another, and where the following step has to wait until the previous one has completed its execution. Let's assume that there are four independent components on a web page when the page is loaded; if one component takes a long time during execution, the rest of the page is going to wait for it until its execution is complete. If execution fails, the page load fails too. One other example is when there is a poll and a rating component on the web page; if the user chooses to answer the poll and give a rating to fulfill these requests, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access