Forum Moderators: not2easy

Message Too Old, No Replies

GD Graphics Library and combining images

Server vs modem speeds

         

twist

4:01 pm on Jan 21, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



After reading some information on a website I have learned, if the information is correct, that the less objects you have on a page, every image is a object, the less 'round-trip latency' (as they called it) you will have.

They say for every object on a page a modem user will recieve approximately .2 seconds of additional dowload time on top of the regular download time.

A have a area on my website which allows for up to nine 30x100 images next to each other. I was going to use this area to provide image links to site sponsors. Lets say I have 40 rotating 30x100 images. Meaning that they appear randomly on each page in no particular order.

My problem is that this will add 9 objects to each page which will increase my 'round-trip latency' by at least 1.8 seconds. I was wondering about using the GD Graphics Library to dynamically combine these images into one large image for each page knocking 1.6 seconds off my page download time.

I know drawing images dynamically can consume a lot of server resources but will combining images be that much of a system hog?

A large majority of my visitors will be 56k users, so shaving that 1.6 seconds is very very important.

DrDoc

5:20 pm on Jan 23, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You also realise it will take longer for the server to even start serving the image, since it has to compose it first?

twist

9:29 am on Jan 24, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I guess thats what i'm trying to ask. Since I would be making the server combine images and not create new images would it be such a burden on the server that it could add 1.6+ seconds to my page download time?

I can always test it myself, I was just hoping someone here might have already tried it so I don't waste time writing the script to see how it works.

tombola

9:47 am on Jan 24, 2004 (gmt 0)

10+ Year Member



twist, if I understand this correctly, you need only a limited number of these combined images.
In that case, I would make these pictures offline and upload them to my server. You can write a small script to rotate these images (similar to a banner rotation script).
This would certainly decrease download time for your visitors.

racer_x

4:15 am on Jan 30, 2004 (gmt 0)

10+ Year Member



I would not worry about it and just go for individual images.

One big image will transfer faster than nine small images. Because you have less overhead, but the difference is going be so small most people probably would not notice.

5 or 6 years it might have made a difference. Back in the good old days of the web, to transfer each image required a seperate TCP connection to the server. But with the advent of HTTP 1.1 the web browser can keep a connect to a server open and transfer multiple images across it. Thereby saving the overhead required to establish multiple connections.

Also by having seperate images they will be able to be stored in the browsers cache individually. While if they are combined into one big image the the image is stored as a whole. If you use the images on several difference pages then it may in fact be faster to go with several small images rather than one big one.

twist

5:17 am on Jan 30, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



browsers cache individually

I didn't think about it like that. Better anyway, saves me time figuring out how to combine the images.

Thanks

tombola

8:29 am on Jan 30, 2004 (gmt 0)

10+ Year Member



Also by having seperate images they will be able to be stored in the browsers cache individually. While if they are combined into one big image the the image is stored as a whole. If you use the images on several difference pages then it may in fact be faster to go with several small images rather than one big one.

Very well, racer_x!

Storyman

8:32 pm on Jan 30, 2004 (gmt 0)

10+ Year Member



Another option is to combine some of the images into one image, then with CSS-P you can position and crop the combined image so that only one of the images shows.

As with everything there are pros and cons.