PDA

View Full Version : Multiple use of an image


chem3
01-25-2006, 09:05 AM
Hello,

I want to use the same image on my web page many times (say 10 times), so will the image be downloaded from the original source each time it is used on the page?

For example, suppose that my html file takes 1 second to load and my image also takes 1 sec to load, and I used that image 10 times on my page, so will it take 2 sec to load and display the whole page, or 11 sec (1 sec to load the html file, and 10 sec to load the SAME 1-sec-loading image 10 times)?

See the following pic:
http://chem3.jeeran.com/1IMG.PNG

blain
01-25-2006, 09:11 AM
Your image would be uploaded in to cache once and then displayed 10 times.

chem3
01-25-2006, 09:21 AM
Your image would be uploaded in to cache once and then displayed 10 times.

So, you are saying that it will take only 2 seconds to load and display the whole page. Did I get it right?

blain
01-25-2006, 09:30 AM
Yes it would only take 2 seconds

mlseim
01-25-2006, 05:17 PM
Is this image going to be repeated as a background or something like that?

With CSS you can automatically repeat an image vertically, horizontally, or both.

body
{
background-image: url(myimage.gif) repeat-x;
}

Possible Values
Value Description
repeat The background image will be repeated vertically and horizontally
repeat-x The background image will be repeated horizontally
repeat-y The background image will be repeated vertically
no-repeat The background-image will be displayed only once

N_R_D
01-25-2006, 08:19 PM
Even more over than that ...

If you have a page that siplayed that images a thousand times ...

It will only need to load that same picture once.

think of Cache as a desk, and your server as a file cabinet.

When the pic is loaded the first time.... it is taken out of the file cabinet and put on your desk, making it readily accessible. So once it is already on your desk, you dont need to yank it out of the cabinet again.....

until you put it back in :)
(i.e. the viewer clearing their cache)

Make sense?

oracleguy
01-26-2006, 12:07 AM
Even more over than that ...

If you have a page that siplayed that images a thousand times ...

It will only need to load that same picture once.

think of Cache as a desk, and your server as a file cabinet.

When the pic is loaded the first time.... it is taken out of the file cabinet and put on your desk, making it readily accessible. So once it is already on your desk, you dont need to yank it out of the cabinet again.....

until you put it back in :)
(i.e. the viewer clearing their cache)

Make sense?

Good analogy.

However I think the one place where that might not apply is if the page is being viewed under SSL because browsers don't cache those pages and I believe any of the linked items (e.g. images).

N_R_D
01-26-2006, 12:09 AM
True ...

chem3
01-26-2006, 08:17 AM
Thank you all guys for the helpful info!