Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.


Question: Problem With Keep-Alive on Apple Devices


I'm a developer and in my phonegap application I have an ajax request that gets called once every 5 seconds.
These requests work correctly on android devices and also on windows (through the browser) computers.
However testing on apple devices (iphone 6s running ios 11.1.1 and macbook white running macos sierra) only the first request works, the second one returns readystate = 0.
After debugging I verified that the problem happens because the keep-alive timeout of the request response header is equal to my request interval, that is, every 5 seconds I make a request and my server's keep-alive timeout was also set to 5 seconds.
Below are details of my environment:
Server: Apache 2.0 - PHP Version 7.1.11 - Ubuntu 16.04 LTS
Server configuration: KeepAlive On; KeepAliveTimeout 5

Sample code:

HTML and JS: Edit fiddle - JSFiddle

PHP (teste.php):

// header("Connection: close"); // to solve the problem, just uncomment this line

echo json_encode(["asd" => 1]);

iPhone 6s, iOS 11.1, The same problem occurs on MacOS

Posted on


Page content loaded

There are no replies.
User profile for user: JSabino01

Question: Problem With Keep-Alive on Apple Devices