Several days ago, I found that some pages of my site would be requested twice each time. I also noticed that this only happens when I am not logged in.
But since I noticed this in firebug console, I thought it maybe just a trick of firebug to show the request but not that the page is requested twice. I also thought the other request may be sent by a plugin of firefox. Then I disabled all the plugins I was using. However, it didn't make any different.
Later, I began to log all the db quries. And found that the page was actually requested twice. Then came the question -- why??? Why it's loaded twice? I wondered it either be the problem of firefox (or the plugins with it) or the problem of Zend Framework.
I updated the Zend Framework to the lastest version 1.9.3. But no lucky. So it must be the proble of firefox. And how about other browsers? I tested this on IE6/7, Opera 10, Safari, Chrome, Arora and found that only IE and Opera did not send the request twice. So now I'm sure the problem is caused by the client but not the server side.
But why do some of the browsers send twice request? Finally I tried baidu, and found it might be caused by the empty value assigned to attribute src of the <img> tag. Then I realised that when not logged in, the user's prifile icon is empty. That must be the couse of the problem! So I assigned it with an 1*1 pixel blank image. Problem solved.
Details please see the http://jrgns.net/node/11 (English) or http://hi.baidu.com/bdui/blog/item/9f6ed4af65c349cf7cd92a1f.html (Chinese).