this is what I see in my local log file when I make a single page request:
Started GET "/" for 127.0.0.1 at Mon Apr 25 22:12:22 -0700 2011
User Load (0.9ms) SELECT "users".* FROM "users" WHERE ("users"."id" = 2) LIMIT 1
Processing by PagesController#beta as HTML
Rendered pages/beta.html.erb within layouts/beta (16.2ms)
Completed 200 OK in 23ms (Views: 18.8ms | ActiveRecord: 7.7ms)
Started GET "/" for 127.0.0.1 at Mon Apr 25 22:12:23 -0700 2011
User Load (0.6ms) SELECT "users".* FROM "users" WHERE ("users"."id" = 2) LIMIT 1
Processing by PagesController#beta as */*
Rendered pages/beta.html.erb within layouts/beta (17.9ms)
Completed 200 OK in 27ms (Views: 21.5ms | ActiveRecord: 6.6ms)
Anyone have any ideas what could be causing this? the Processing line is interesting?
PagesController#beta as HTML
PagesController#beta as */*
What does that mean?
I’ve seen this happen because of an
imgtag with a blanksrcattribute. Giving animg,script,linkor similar tag asrcorhrefattribute=""will resolve to the current page. So it will try to load the page a second time as it tried to load the asset. It could also be in a CSSurl()property or an AJAX call.One easy way to tell is to temporarily put something like
<base href="http://example.com" />in your<head>section. That will prefix any links on the page, which should prevent your local page from being called twice if it is that sort of problem.I’ve also seen some browser extensions that query the page in a separate request. I’ve noticed this specifically with the Web Server Notifier and Web Technology Notifier extensions for Chrome. Try an “incognito” window or a separate browser and see if you get the same result.