Skip to content Skip to sidebar Skip to footer

Why Is Synchronous Xmlhttprequest Considered As Deprecated?

I already know the difference between synchronous and asynchronous requests, like explained here for example: Synchronous and asynchronous requests When you try to make a synchron

Solution 1:

You're mixing different concepts which is why you're wondering why it was deprecated.

Firstly, the asynchronous calls were not invented to make calls faster. In fact, they have almost zero impact on the speed.

Secondly, the asynchronous calls were not invented to specifically make required or non-required calls. It is the responsibility of the developer to make such a decision.

Having said that, the message answers the question clearly:

because of its detrimental effects to the end user's experience

Your main confusion is about the goal of the asynchronous calls. The whole idea behind asynchronous calls is NOT to ensure that the user will not have to wait for the results, but it is to make the application more responsive.

You gave an example of the required call during the page load. By using asynchronous request, the user will still have to wait for the results (the goal of asynchronous calls is not to solve this problem), but the application will stay responsive to the user input. For instance, some applications can have a [Cancel] button so the user can cancel the request. Some other applications may display some animation or progress bar. You, the developer, decide what to do, but only asynchronous gives you this chance to make the decision. Synchronous calls on the other hand will block the execution, the application will look like frozen, you, the developer, cannot do anything during the call, and that's the detrimental effects to the end user's experience the message is talking about.

Post a Comment for "Why Is Synchronous Xmlhttprequest Considered As Deprecated?"