I'm using Firefox 3.6.6.
I have a PHP script called index.php
with the following code:
<?php
sleep(20); die(time());
?>
I open two browser tabs, copy the URL into each of them, and then quickly hit enter in each tab. The first tab completes in just over 20 seconds. The second tab completes in just over 40 seconds.
I do the same experiment in IE and both scripts complete within a second of each other, around 20 seconds.
Is this expected behavior? The actual script that caused me to test this is a synchronous procedure. I want any person attempting to execute it twice to receive an error that the process is already in progress, rather than having the browser sit there and wait until it can execute it a second time.
If this is how Firefox works, how does it determine when a page is a duplicate and that it should queue up the requests rather than run them simultaneously?
I can fool it by putting a junk GET string on the end, e.g. index.php
and index.php?JUNK=1
both complete at around 20 seconds.