Hi. I have a problem with PHP blocking loading of another php page until the first completes loading.
My page loads content from an external site. If I click on a link to a PHP page before the content is finished loading, it will not go to the page until the external page is completely loaded. If I click on a link to an HTML page, I can go there right away.
Here's a contrived example I set up:
My first page looks like this:
page1.html:
<A HREF="page2.php">Slow!</A><BR>
<A HREF="page3.html">Fast!</A><BR>
<IMG SRC="image.php">
page2.php:
Here it is!
page3.html:
Here it is!
image.php:
<?
sleep(10);
readfile("/tmp/bb.gif");
?>
Here is my apache log:
127.0.0.1 - - [13/Mar/2001:10:54:55 -0500] "GET /page1.html HTTP/1.1" 200 91 "-" "Mozilla/5.0 (X11; U; Linux 2.2.16-3 i686; en-US; 0.8) Gecko/20010215"
127.0.0.1 - - [13/Mar/2001:10:55:06 -0500] "GET /image.php HTTP/1.1" 200 13360 "http://127.0.0.1/page1.html" "Mozilla/5.0 (X11; U; Linux 2.2.16-3 i686; en-US; 0.8) Gecko/20010215"
127.0.0.1 - - [13/Mar/2001:10:55:06 -0500] "GET /page2.php HTTP/1.1" 200 24 "http://127.0.0.1/page1.html" "Mozilla/5.0 (X11; U; Linux 2.2.16-3 i686; en-US; 0.8) Gecko/20010215"
I clicked the "page2.php" link immediately. Notice the 11 second gap in the log. Here it is if I click the page3.html link:
127.0.0.1 - - [13/Mar/2001:11:06:55 -0500] "GET /page1.html HTTP/1.1" 200 91 "-" "Mozilla/5.0 (X11; U; Linux 2.2.16-3 i686; en-US; 0.8) Gecko/20010215"
127.0.0.1 - - [13/Mar/2001:11:06:56 -0500] "GET /page3.html HTTP/1.1" 200 12 "http://127.0.0.1/page1.html" "Mozilla/5.0 (X11; U; Linux 2.2.16-3 i686; en-US; 0.8) Gecko/20010215"
127.0.0.1 - - [13/Mar/2001:11:07:05 -0500] "GET /image.php HTTP/1.1" 200 13360 "http://127.0.0.1/page1.html" "Mozilla/5.0 (X11; U; Linux 2.2.16-3 i686; en-US; 0.8) Gecko/20010215"
Still a gap before the image.php request, but the page3.html request happens as soon as I hit the link.
I'm running Apache 1.3.14 on Redhat 6.2 with kernel 2.2.16-3. I'm running PHP Version 4.0.4pl1.
Any help would by greatly appreciated. Thanks.