Anonymous 0

Hello, Does anyone know why the main picture (after clicking a thumbnail) takes so long to appear. Thanks for your time.

  • Thanks for all the great advice. I didn't make the site but all the advice will help in solving the problem. Thanks again. sbl2000 over 5 years ago

3 answers

Ktash 1851
1
point
This was chosen as the best answer

I agree with @Tony Crockford that that may certainly be an issue here, but I'm not sure its the root of the cause. Looking in Firebug, it is taking me anywhere from ~0.8s to over 4s to receive the image from the server. And, while I agree with @Artistic Adobe in the file sizes being fairly large, they still shouldn't be taking over 4 seconds to load, or even ~1.5s for one of the smaller images (40kb). My best guess is that you've got a bit of overhead here, so I'm going to recommended places to look to slim things down all around, but I'll also recommend a few other things to look into.

Slimming Down

  • Insead of using a full HTML page to serve the image, try using something lighter, like JSON (examples, PHP Manual)
  • If you choose to not use JSON or another method, get rid of the header information in the page, including links to stylesheets, jQuery, and Google Analytics. These are being processed every time, even if they are not being loaded (because of caching)
  • As @Artistic Adobe suggested, slim down the file size overall to ~50 to 60kb.

Look into

  • Check the bandwidth allotted from your host. Make sure you are getting all you can
  • If you have access, I might check and make sure PHP settings are not set to try and interpret image files as PHP files before sending them out
  • Again, if you have access, I might try logging requests to the system through apache to see what might be slowing it down
  • If you're still not getting results you think you should, talk with your host and see if they can help you troubleshoot the cause of the slowing.
Answered over 5 years ago by Ktash
  • Ktash thanks for all the info. Some of the hints are beyond and I would have to read up on them. What did you mean about getting rid of header info? sbl2000 over 5 years ago
  • No problem. What I meant by get rid of the header information is that, with each ajax call, you return not only the div with the element, but also the <html><head><title>... information as well. Slimming it down and returning just the div or divs would be better. Ktash over 5 years ago
2
points

Your images are large in file size which makes them take longer to load. The dimensions are okay, but you'll need to compress them for web. Photoshop has a "save for web" setting. Try to get each image size down to around 50 to 60kb instead of over 200kb.

Answered over 5 years ago by Artistic Abode
1
point

I'd say it's associated with the jQuery:

$(window).load(function () {

    $('.singlePost').hide().delay(500).fadeIn(1000);
    $('.singlePost').css("visibility", "visible");
});

I'm just guessing that you have a 500ms delay after the image is available and a 1000ms fade-in

Try adjusting those settings and it will speed up a bit.

Answered over 5 years ago by Tony Crockford