views:

39

answers:

1

Hi!

I am merging all my site icons in sprites, but, for some reasons, sometimes I have to add a little white space between some.

http://img8.imageshack.us/img8/9793/16spritetest4.png

In this image, the icons on left are the ones that need space around them.
I wonder what is better for server/user: to split the icons on left from the other ones in 2 separated images, or to have all in one, with "wasted" empty pixels.

I ask this, because I know http requests are expensive, but I also know wasted pixels make file size bigger. I just want to know which is worse.

There will eventually be other sprites that will be very irregular (not with icons all with 16x16 pixels), so the question will be the same.

Thanks in advance.

A: 

I think the theory of "http requests are expensive" is wrong actually.

As far I know, HTTP 1.1 doesn't start a new connection everytime a request is made. This makes less latency, so probably there should be no much difference between having sprites or separated images.

Please correct me if I'm wrong.

Nuno Peralta