Click to See Complete Forum and Search --> : Number of requests


G-Sun
07-03-2009, 04:13 AM
Hi!

I'm redesigning a web-site, and see that I use many small files for building the graphic. Is that a bad practice?
Should I try to get the number of requested files as low as possible -using bigger images instead?

Number of requests is now 35, with total 173kb. But it will be more..

Thanks!

kiwibrit
07-03-2009, 05:43 AM
I am not quite sure what you mean. In my view, fast page loading is good (even now that broadband is widespread) so trying to keep the overall size of the page down means keeping the image sizes and quality down as fas as is acceptable. However, I have never thought the number of files to be an issue in itself.

G-Sun
07-03-2009, 11:12 AM
I was thinking about the time of downloading let's say two images vs. downloading one where the two are combined. Or making a border with top-, middle-, bottom-images vs. using 8 (4 corners and 4 sides).

svidgen
07-03-2009, 12:52 PM
Combining those images will keep the total weight of those images down, both in total filesize and latency. Just be aware of the caveats when using CSS sprites. A lot of folks have you set the image as a background for a DIV--bad move, IMO. To avoid a hit to search engine visibility, use transparent IMG's with "unique" URLs: http://svidgen.com/sprites

Bear in mind though, if your page is meant to be printed (at all), all CSS sprite techniques leave most users without images on their printed copy.

But yes, the technique you're describing is one of the recommendations by the YSlow team. Be sure to set expires headers too!

svidgen
07-03-2009, 12:53 PM
PS
If you're making rounded corners, use a single image for all four corners, if possible: http://svidgen.com/rcg.php

Edit: I think my corner generator may actually be slightly incompatible with IE<7 ...

G-Sun
07-03-2009, 02:03 PM
Thanks svidgen!

I use a single image for four corners already :)

I'll include most of the other tips to my page. Thanks!