views:

54

answers:

1

I'm working on a messy PHP page by another developer and I was analyzing the resource view in the Webkit developer tools and noticed that the page (index.php) makes an HTTP requests for itself and then interprets the results as an image despite it being sent with the text/html header. Because of this it throws the warning:

Resource interpreted as image but transferred with MIME type text/html.

Looking at the time graph the call comes after the <head> because it has already requested images for the body. Sometimes there are even two 'bad' requests.

Can anyone explain what might be happening and/or suggest how to fix this? Could these be related to PHP includes?

+1  A: 

Not sure how Webkit is making requests, but the only time I've seen this kind of behavior (a script calling itself as an image) is when:

  • Image URLs are supposed to be generated and are not - leaving the image source as '' or this current URL.
  • A mod_rewrite is too 'greedy', and redirects image requests - including the browser's favicon request - to the bootstrap (or similar) script.

Does Webkit request a favicon? That would be a later request in the timeline.

Tim Lytle
I think the first one is pretty likely. A bit more on it here: http://developer.yahoo.com/performance/rules.html#emptysrc
Regis Frey