Topic 1 Question 26
You are writing a single-page web application with a user-interface that communicates with a third-party API for content using XMLHttpRequest. The data displayed on the UI by the API results is less critical than other data displayed on the same web page, so it is acceptable for some requests to not have the API data displayed in the UI. However, calls made to the API should not delay rendering of other parts of the user interface. You want your application to perform well when the API response is an error or a timeout. What should you do?
Set the asynchronous option for your requests to the API to false and omit the widget displaying the API results when a timeout or error is encountered.
Set the asynchronous option for your request to the API to true and omit the widget displaying the API results when a timeout or error is encountered.
Catch timeout or error exceptions from the API call and keep trying with exponential backoff until the API response is successful.
Catch timeout or error exceptions from the API call and display the error response in the UI widget.
ユーザの投票
コメント(11)
Answer is B. Api should not delay rendering: asynchronous Application perform well when Api error or timeout: omit the widget
👍 11[Removed]2020/06/10Correct answer is B
Asynchronous handling provides the ability to call the API in the background without blocking the rendering of other elements. If the response is received it can be rendered or omitted if a timeout occurs.
👍 6syu31svc2021/07/30It should be B), isn't it? Proposed answer A) uses synchronous behaviour so will block execution, it contradicts the question
👍 4emmet2020/05/29
シャッフルモード