Search code examples
csscss-spritessprite-sheet

Css Sprites - Is my file too big?


I have used before different images on my webpage and now i'm coming to optimization. It's a dating site by the way.

What i have done is combine all images which i'm going to use into 1 image where the size is 280KB.

Now to my question: Is that file to big? Should i continue to have it as css sprite or should i do as i did before have small images and display them image by image?


Solution

  • Its fine to have a sprite upto 1 - 1.5 MB.

    What's important is how many images are there in the sprite or in other terms how many HTTP requests do you save.

    If you have 200KB sprite and it has only 2 images in it then it may be inefficient to use it, but if you have 5 MB sprite and there are 100 images in it then you're saving a lot of page loading time as only 1 request is made to your sprite, thereby saving 99 requests.