tags:

views:

71

answers:

3

Lets say I have an image gallery of 20 photos, then lets say I want to have another image as an image overlay on top of the 20 photos to make rounded corners or any other thing.

So that is 20 different photos + 1 photo that is called 20 times to be on top of the photos

Does the browser count this as 21 calls or http connections or as 40?

+2  A: 

Multiple requests to the same resource on the same page will only cause one HTTP connection. So you fetch the same image 20 times or just one, if the image has the same filename and doesn't have query strings appended to it, it will cause only one transfer.

Andrew Moore
thanks thats what I need to know
jasondavis
A: 

Once the browser has the image for the overlay, it should be in the cache and therefore not needed to be called again. I'm going with 21 requests.

idrumgood
A: 

Every browser should recognize that it just downloaded the overlay file and pull it from cache for the other 19 photos.

The easiest way to make sure is to just try it and check your access logs, of course, but I'm not aware of a browser that isn't smart enough to handle this correctly.

Eevee