How long is the maximum time of interface request set?

Posted May 27, 20201 min read

  1. In the front-end project, under normal circumstances, the maximum time for the interface request is set to 20s or 30s. After this time, the interface data will not be requested, and the interceptor will be started, and a prompt message will pop up to inform the user of the reason, preventing the user from long Uselessly waiting.
  2. In some cases, the interface request time needs to be set longer, such as the interface for uploading files or pictures. The maximum time for this type of interface request is to consider the size of the uploaded data. It is generally set to 60s or longer. Before the data is transmitted, the interceptor is started and the transmission is interrupted, which will inevitably throw an exception and mislead developers and users.