While testing for a long execution script I came across a strange problem so I tried to test it using a simple script. For sake of testing I made a simple PHP page with below codes.
<?php
sleep(60);
echo 1;
?>
I ran this page in the browser and while it was executing in the mean time made changes to the code by just simply commenting the sleep function, saved it and then ran the same page in another tab of the same browser. I was expecting the output should come instantly in the second tab but it came only after execution of the code in the first tab.
I repeated the above steps but this time appending random numbers in query string. It worked as expected i.e. though first tab was executing the page second tab echoed the result.
Now I am interested to know why browsers are not executing the same page in two different tabs though the page had changed in the mean time. I tested it in Firefox and chrome and my server is Apache.