Images not loading randomly. Mvc 2 site

Discussion in 'Site Programming, Development and Design' started by Steve Haunts, Feb 19, 2011.

  1. Hi

    I have started having a strange problem on my site over the last few days ( When you load or refresh the site some of the images wont load. This is happens randomly but if you do a reload image (firefox) they reload fine.

    The images are stored in the content folder but the url for these come from a products database.

    This has only started happening over the last 3 days since the last sql server maintenance outage (maybe a coincidence). Winhost have said they can't help and insist its a programmign issue but I am not so sure.

    I have not done any new releases for weeks and it works fine on my local dev server, even when its connected to my database at Winhost.

    The site is mvc 2. Has anyone seen this before? As i said it was working fine earlier in the week and then it has suddenly gone wonky.

    Could there be a time out issues on the server maybe? Any ideas would be gratefully accepted :)

    Last edited by a moderator: Oct 14, 2015
  2. Interestingly this loads fine in ie6 but any other browser is goes weird.

    I have inspected the source in firebug and all the urls for the images are correct.

    This is really stumping me. is there a rendering timeout somewhere? the html looks correct but the server is just not serving the images correct each time. yet if you right click on the broken image in firefox and click view image it loads fine.

    This is startign to worry me now as we have a marketting promotion running and i am worried customers will think the site is knackered.
  3. Just used the fiddler web debugger and for the images that are not displaying it is reporting 'HTTP Error 503. The service is unavailable.' for each file that it cant display.
  4. The support guys have now sorted this; Hopefully this will sort it. If anyone has the same problem and encounters this post, then see the reply from tech support below:


    we have quadrupled the connection limit for your account to accommodate the high traffic of your site on our server.

    please let us know if the problem still persist."
  5. Thanks for following up.

    I suppose they also told you that increasing the connection limit can lead to bandwidth issues? It depends on the size of the images you are loading, I suppose.

    The default concurrent connection limit is adequate for 99% of sites, but as you've seen, we can increase it if necessary.
  6. I wasn't told that no, but all my images are very small.

    How big is the default app pool size. My site doesn't get excessive traffic. It has been raised over the past week due to a promotion I am running but it is not exactly huge.

    The thing that annoyed me the most about this is that my first 2 tickets were bounced back to me as an 'programming error on my part' and the support person wouldn't look at it further. My site is as simple as they come when it comes to programming logic, its just a shop window, the cart and digital delivery system is handled and hosted elsewhere.

    Hey ho it's sorted now and I know to include logs and screen shots from fiddler to prove the 503 errors if it happens again.
  7. That depends on which account your site uses. For the Winhost Basic account the application pool is 100MB. For the Max or Ultimate plans, it is 200MB.

    Your initial tickets probably got the response they did because your issue is unusual. As I said, maxing out concurrent connections doesn't happen on most sites, so it isn't the first thing they would look at.
    Last edited: Oct 14, 2015
  8. I have double checked my data access to make sure everything is as it should be with connections and I close the db connection after each call ( I just wanted to make sure ;-)

    Is this literally just because I had elevated hits due to a promotion I was running.

    Next time I run one of these promotions would it be worth me getting in touch with support and getting my app pool restarted?
  9. Ray


    To call on your images, what is the path you are using? You said URL so I'm wondering what that means? Is it something like

    Is it similar to this when you are calling on the path of the image?
  10. Ray


    I pulled up the image and I did see the image with a broken link. Are you saying that the path you use to call on the image has "http://..."?
  11. not really sure where this is going :)

    but yes at the moment the links for images generated from the product database are absolute paths. They were relative, but when I was debugging and testing on saturday to see if it was anything I had done, I switched them from relative to absolute. I will probs change it back to relative, but not quite sure why this would be a problem, the images would get displayed regardless.

    The problem on saturday was the server was randomly returning http 503 errors for random images. If the file couldn't be found it would have been a http 404.
  12. Ray


    http 503 error messages is typically caused by using up all of your http concurrent connection. So, if you call on your image... Lets say...

    <img src="" alt="some_text"/>

    ...You are essentially using an http call...

    But if you call it with this path...

    <img src="../images/image1.jpg" alt="some_text"/>

    ...Then you are not using an http call.

    Being that you are pulling up your site and your application itself is calling the images through http, than I can see how you can easily consume your http concurrent connection.
  13. Initially when the problem started I was using relative paths, ie

    <img src="../images/image1.jpg" alt="some_text"/>

    but I changed it to absolutes (via http) to test something.

    I'll revert those changes and reupload the dll's, but it wasn't that which caused the problem initially as I changed that after the fact.

    Interesting point though. Thanks

  14. Ray


    For now try inputting the full server path. You can see it in your Winhost control panel. Basically it may look something like this...

    E:\web\[account name]\images\images1.jpg
    Last edited by a moderator: Oct 14, 2015
  15. I have already uploaded the change :) I just reverted that change in subversion. Product images are now relative paths.

Share This Page