Jump to content

How to minimize load time of page with lots of images


denno020

Recommended Posts

One of the pages on my football clubs website is going to have lots of player images on it. It's the players page, and it basically shows the photo's of all players (150x113 ~30KB jpg's), along with their number and player sponsor. I want all of the photos to appear on the page, I don't want to separate it up using pagination.. So is there anything else I could do to minimize the load time of the page? Each image is loaded itself, so there will be a lot of HTTP requests, but I don't think sprites will work in this situation..

 

Very keen to hear any ideas.

 

Cheers

Denno

Link to comment
Share on other sites

Well we're talking about the whole senior squad, so roughly 30-35 images? Could be upwards of 40+ though..

 

So I'm stuck with just having to optimize the crap out of each of the images?

 

Thats ok, was hoping there might be a trick to have them load last or something or rather..

Link to comment
Share on other sites

well if no one in the team changes a sprite would be a nice solution, 40 header request or 1 makes a huge difference.

What you could also do is on the main page, you load all images and set them to display:none; you might try to use javascript to load them after the page is ready. That way the images are in the browser cache and will load instant when on the team page.

Link to comment
Share on other sites

Yeah I was thinking a sprite.. but that would obviously take a little bit of work to stitch all the photo's together and then appropriately move them into position for each person.. Loading the pictures on the frony page sounds interesting.. I could just load like the first 15-20, so part of the page that is in view will display straight away. And then depending on how fast someone starts scrolling down, they'll see the other photo's waiting to load or not..

 

So for that I will need to search Google for how to load images into cache using javascript?

 

Thanks

Denno

Link to comment
Share on other sites

I recommend not to show 40 images on your index.php.

 

So what i said was include in your index.php a script that loads the images after everything is loaded but don't display them (that way they experience it all as smooth). Ones the person visits the team page all images are in it's cache.

 

and yeha as far as the solution, loads have been written on this, a nice way could be jquery: http://engineeredweb.com/blog/09/12/preloading-images-jquery-and-javascript

 

Link to comment
Share on other sites

No no I wasn't interpreting that as displaying the images on the front page.. I knew what you meant about loading them into the cache, but not actually displaying them when loaded. I would therefore make them the very last thing to load on the index page right? As they're not going to be displayed anyway..

 

Cheers

Denno

Link to comment
Share on other sites

I wish you guys would quit adding things to my list that I need to do... ;)

 

I have the same situation twice with images to load.

 

In the first it is 32 images of members where I load thumbnails with img src and there is 0 lag on load time.

 

In the second I have about 100 airplane images, not thumbnails, and I did have to break it down because of load time. Since I don't know what pagination is, I just link from one page to another.

 

But I will look into what ya'll are talking about when I get some other "stuff" fixed.

Link to comment
Share on other sites

another thing you can do is to use multiple subdomains

 

there's a limit to how many "streams" a browser can use at once from any one domain

 

serving images from more than one domain/subdomain increases the number of synchronous "streams"

Link to comment
Share on other sites

another thing you can do is to use multiple subdomains

 

there's a limit to how many "streams" a browser can use at once from any one domain

 

serving images from more than one domain/subdomain increases the number of synchronous "streams"

isn't that 2 requests per domain? so that would make it 20 subdomains

 

Link to comment
Share on other sites

another thing you can do is to use multiple subdomains

 

there's a limit to how many "streams" a browser can use at once from any one domain

 

serving images from more than one domain/subdomain increases the number of synchronous "streams"

 

If you are on a shared host or host with a "low" number of concurrent connections you'll find users unable to visit your website due to no available connections.

Link to comment
Share on other sites

Yeah I was thinking a sprite.. but that would obviously take a little bit of work to stitch all the photo's together and then appropriately move them into position for each person..

 

Just imagine what happens when player's leave, new ones are recruited. You would be constantly updating the sprite.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.