问题
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