Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pages load twice on Firefox?

I thought I had answered this question before thanks to StackOverFlow, but I hastily took an answer and it turns out not to be the real cause to my problem.

I have checked my Apache Access Log:

This is me browsing my web app on Google Chrome Browser.

127.0.0.1 - - [06/Jan/2010:22:17:35 +0000] "GET /webs/end/new.php HTTP/1.1" 200 2146
127.0.0.1 - - [06/Jan/2010:22:17:36 +0000] "GET /webs/end/settings.php HTTP/1.1" 200 4548
127.0.0.1 - - [06/Jan/2010:22:17:38 +0000] "GET /webs/end/index.php HTTP/1.1" 200 2042

This is me browsing my web app on IE7.

127.0.0.1 - - [06/Jan/2010:22:21:49 +0000] "GET /webs/end/settings.php HTTP/1.1" 200 4548
127.0.0.1 - - [06/Jan/2010:22:21:50 +0000] "GET /webs/end/index.php HTTP/1.1" 200 2042

This is me browsing my web app on Firefox.

127.0.0.1 - - [06/Jan/2010:22:18:08 +0000] "GET /webs/end/settings.php HTTP/1.1" 200 4548
127.0.0.1 - - [06/Jan/2010:22:18:09 +0000] "GET /webs/end/settings.php HTTP/1.1" 200 4548
127.0.0.1 - - [06/Jan/2010:22:18:10 +0000] "GET /webs/end/index.php HTTP/1.1" 200 2042
127.0.0.1 - - [06/Jan/2010:22:18:10 +0000] "GET /webs/end/index.php HTTP/1.1" 200 2042
127.0.0.1 - - [06/Jan/2010:22:18:11 +0000] "GET /webs/end/new.php HTTP/1.1" 200 2146
127.0.0.1 - - [06/Jan/2010:22:18:12 +0000] "GET /webs/end/new.php HTTP/1.1" 200 2146

This is just me clicking around. But notice that for every page request firefox seems to be loading the page twice and its effecting my PHP scripts as they are executing twice and making two insertions into my DB!

Why is the case? I am using Firefox 3.5.6. I am guessing this is a Firefox issue rather than a PHP/Apache one?

like image 446
Abs Avatar asked Jan 06 '10 22:01

Abs


People also ask

How do I stop multiple tabs opening in Firefox?

Go to about:home, and click settings. On the General tab, check to make sure your current homepage is not set to multiple tabs. Homepage links will be separated by '|'. Go to about:home, and click settings.

How do I get Firefox to open the same page at a time?

Firefox supports multiple "home tabs." open the pages in tabs that you want them to appear in startup then open options -> Home in "Homepage and new windows", click the "Use Current Pages" button.

How do I have multiple homepages open in Firefox?

Please follow the steps Step 1: Go to Firefox Options Window Go to: Tools menu -> Option menu-item -> Main Tab. Step 2: Set two websites in Home Page Field – delimited by | Set the 'When the firefox starts' drop-down to 'Show my home page' Enter multiple websites delimited by | (pipe symbol) as shown below.


2 Answers

What plugins have you got installed in Firefox, they may be making requests silently, especially FireBug. Try turning firebug off & see if it still happens.

As mentioned in the comment below, the latest version of FireBug shouldn't be doing this, so if it isn't, try disabling all your plugins (or running FireFox in safe mode) and see if it still happens

like image 186
Glenn Slaven Avatar answered Nov 02 '22 15:11

Glenn Slaven


Check out the Accept headers on the 2nd request. Does it look to be a request for an image? If so, you may have an empty "src" attribute on an "img" tag or an empty "url" definition in a CSS property which is causing the 2nd request.

More info here: http://icanhascode.com/2008/06/the-mystery-of-the-multiple-requests/

In general, this issue is a pain to track down.

like image 26
Michael Morton Avatar answered Nov 02 '22 17:11

Michael Morton