简体   繁体   中英

Mobile Safari (iPhone) has 30 sec + latency for Javascript GET requests

I am developing a mobile web application: www.bazmo.com. When I test the site, the latency of the GET JS requests can get up to 30 seconds. It basically seems broken to the user.

Here is how I recreate the error:

  • Turn off cellular (wifi only)
  • Clear History and Website Data
  • Open safari and go to a page like www.bazmo.com/best/laptops
  • Then click on the logo to go to the home page at which point it gets stuck for 30 seconds before the JS files load if they are not cached

I sometimes can catch it on Web Inspector and it just shows the JS not being loaded for 30 seconds.

What am I missing here.

I just use simple: to insert the files in.

I found a work around but not a permanent solution. The website uses Google App Engine.

The line:

script src="/javascript/categoryScript.js"> just did not work on safari mobile.

However the line:

script src="yourid.appspot.com/javascript/categoryScript.js"> does since it is trying to retrieve from another domain.

This helps provide a workaround but it is pretty bad form that I can't use the path from the domain itself.

I have been trying to find a way to make that work but no dice so far.

We had the same issue and problem was that our back-end returned 204 status and not 200 . BUT this issue was caused by using HTTP OPTIONS method and not GET (but it can be caused by the same thing).

Related reading:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM