PHP Comet problem
Consider "test.htm" making an Ajax request to "test.php":
test.htm: window onload=ajax request( test.php,callback )
test.php: <?php sleep( 20 ); echo "foo"; ?>But browser is being reloaded before recieving the response.
When webpage loaded for first time, response was as expected @20.02s
after first refresh: 27s, second refresh: 26s, third refresh: 27s, so on around 27s. ( Ubuntu 10, Firefox 3.6 )This all discrepancy occur, when i reload the page while response is yet to be recieved. If i reload the page after response f开发者_JAVA技巧rom test.php, there is no problem.
Any remedies/did i go wrong somewhere in backend/ajax is being cached??
You are making Ajax request to test.php
, thats why your browser doesn't wait for the response to be received. Make the call Synchronous.
精彩评论