Chrome is slow to load first AJAX response

为君一笑 提交于 2019-12-23 18:58:40

问题


I am building an application using React and Flux. Clicking in a list of items initiates an action which then starts (via an effect) an AJAX request using axios (though I have tried superagent-bluebird-promise with the same results).

The issue is that using Google Chrome, when first making this request, there is a delay of approximately two seconds between clicking the item in the list and the AJAX request being initiated. Subsequent clicks instantly start loading the request.

Using Firefox, all requests are instantaneous.

Edit: I have tested on two Ubuntu PCs, and can replicate the same symptoms. I can also replicate the symptoms on my Android, with a bigger delay (about 4 seconds).

Here is a screenshot of a profile made under Chrome:

Is this a bug with Chrome, or what?


回答1:


It is a bug with Chrome.

The project I'm writing has some code which is (more or less) directly copied from a previous (unfinished) project of mine.

Running the old project again, I encounter the same issue with Chrome. It never occurred before when I was working on it (a few months ago).



来源:https://stackoverflow.com/questions/35562083/chrome-is-slow-to-load-first-ajax-response

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!