Chrome just doesn't finish loading JS files

前端 未结 6 1353
名媛妹妹
名媛妹妹 2021-02-05 05:51

I am writing an app that includes about 12 short JS files in the section (I know, I should merge them and move them just before the end of

6条回答
  •  孤街浪徒
    2021-02-05 06:35

    More than an answer, here's how I would troubleshoot the problem.

    One of the things I'd try is commenting out tags one at a time and reload, to see where the threshold is. Also, because this is probably a server configuration problem, I'd restart it after each try, to have a clean slate, so to speak, i.e., no state preserved between tries.

    I'd try to get more hints by trying to make the requests for the various Javascripts from a script in your favourite language. Ideally, I'd try GETting the scripts one by one (say with curl) waiting a few milliseconds between requests. I imagine I'd hit a threshold here as well. Like, getting one script per second works, but when requests get too close, the server gets stuck.

    If still no clue, I'd use tcpdump to watch the traffic between the browser and the server. Okay, this may be a little too low level!

    But perhaps I'd use netstat to see how many connections the browser opens in parallel to the server to fetch the resources, and see if we hit a concurrency limit.

    I'm sorry this is a solution but I hope you get some ideas, and I'd be very curious to know what your problem is, in the end!

提交回复
热议问题