What is an advantage of making a website asynchronous?

Question

In the context of this lesson, what is an advantage of making a website asynchronous?

Answer

Making a website asynchronous can offer many benefits. Probably one of the most important benefits is that a user can continue browsing the site without the entire page having to reload, because the page does not have to wait for some method call or request to complete.

For example, many popular sites have an upvote/downvote feature for posts, so that you can like or dislike some content. If a synchronous site implemented this feature, then whenever you press upvote or downvote, then the entire page would have to reload, because the request has to be submitted and processed. However, if the site is asynchronous, then when you press upvote or downvote, it will send the request asynchronously so that the page does not have to reload, and the request would be processed whenever the server receives and completes it.

26 Likes

Very clear you explanation, but as you mentioned the example of upvote/downvote, when you click whatever option you have selected and (for instance FACEBOOK) the upvote or downvote. My question is: When you click like or dislike and add +1 or -1 is that an async method or why the option is recorded immediately? or is there a method “awaiting” that would perform the commit?

Thanks in advance.

it depends on your implementation, you could do the +1 or -1 and update the webpage right away or send a request to your server (async) and await the response and then update the front-end.