1

I'm generating <img src= html in a php web-site. The sources of the pictures come from outside sources, like instagram and such (vary). Sometimes, the pictures don't load in the browser and I see an "X" instead of the picture. The image url (right click) points to the right location. If I refresh the page sometimes it does load, sometimes only some, sometimes all the pictures. I don't really understand the pattern.

Can someone point me to possible reasons?

UPDATE due to comments below: How can I check the external server's response? If it failed can I request again? Should I?

Noam
  • 3,341
  • 4
  • 35
  • 64
  • 3
    Well probably external server didnt served requested image data. – svlada Jul 31 '11 at 08:20
  • 2
    Using FF with FireBugs can be useful in diagnositcs. – Brett Walker Jul 31 '11 at 08:23
  • @svlada When I open the image source in the browser it always loads Ok (going directly to the image url). How can it be that sometimes the external server doesn't serve my request? Can I ask him to retry a couple of times? – Noam Jul 31 '11 at 08:42
  • @Brett what should I be looking for in FireBugs to diagnose my problem? – Noam Jul 31 '11 at 08:43
  • 1
    Check the NET panel in firebug, that might help – Sudhir Bastakoti Jul 31 '11 at 08:57
  • Does this similar question helps you? http://stackoverflow.com/questions/263359/how-can-i-determine-if-an-image-has-loaded-using-javascript-jquery – svlada Jul 31 '11 at 08:57
  • 1
    If the image doesn't load when it's inlined but it does when you view it directly by URL then there's a pretty good chance that the server in question has implemented some form of technique to prevent external linking. – GordonM Jul 31 '11 at 09:19
  • @GordonM but it does load sometimes. – Noam Jul 31 '11 at 09:54

1 Answers1

2

You can use Firebug for network monitoring alternatively you can run wireshark to view HTTP requests for the images and the server's response (or failure to respond).

It might be that the server serving the images cannot cope with a series of requests in quick succession or that it implements some sort of request throttling. I'd temporarily copy some images to a different server for a comparative test.

RedGrittyBrick
  • 3,827
  • 1
  • 30
  • 51