Implemented  Sprites

Andy Huang

Well-known member
The forum already loads ridiculously fast. But I think it will be even faster, and lighter on the server (1 http request instead of how many ever now) if we make use of CSS sprites for things like smilies, buttons, etc.. I've looked around and saw no suggestion for this, so I figured I'd throw this into the pot :)
 
Upvote 3
This suggestion has been implemented. Votes are no longer accepted.
After all the discussion i have come to this conclusion, I guess sprites would be good for sites like facebook and yotuube where the images don't change that much. They had 1 set of similies and buttons for about 2 years now. For a software like this where to each man his own, it would end up doing more harm than good.
As long as there is a system to build the sprites automatically from Admin-uploaded images, it would do more good than harm.

The way I've seen them doing gradients around the site I don't think it would be possible to have a gradient sprite, because the gradients are used on elements of varying width and height.
Sprites should work fine for gradients as long as you have all your horizontal gradients in one sprite and all vertical gradients in another.
 
Sprites should work fine for gradients as long as you have all your horizontal gradients in one sprite and all vertical gradients in another.
No, unfortunately it still wouldn't work due to the way gradients are used throughout the site. For example, a transparent gradient is used at the top of the information block on a user's profile page. Problem:

PfsDv.png


Now, I know you're thinking, "well just put enough space in between them so that the others don't show up." Despite being not a very practical solution (the extra space would just make the PNG larger, negating the point of sprites in the first place), I'm pretty sure gradients are used in places with completely dynamic content where spacing out the sprites simply wouldn't work. :)
 
No, unfortunately it still wouldn't work <snip>
Yes, those are some of the caveats. Gradients in sprites are simply problematic, and depend a lot on how you're using the gradients. They're not always feasible. There are also browser-specific problems with sprites-- IIRC, Opera chokes on sprite images wider than a certain width.
 
I'd say easily 60% of my over 400 smilies are animated, each one with a different frame rate, so sprites would be useless for smilies for me... for static buttons and logos it's arguable but I'd still skip on it to prevent the overhead in setting (and re-setting) it up.
 
Sprites are nice, but I would never really use it for a forum.

I would. :) There are certain small elements that aren't just a quick image replacement, and part of integral system. Putting those in a sprite would help, especially if it's on your CDN.

Everything else, for style reasons, and what not, should just be convenience for the customers of XenForo and stylers; separate
 
I would. :) There are certain small elements that aren't just a quick image replacement, and part of integral system. Putting those in a sprite would help, especially if it's on your CDN.

Everything else, for style reasons, and what not, should just be convenience for the customers of XenForo and stylers; separate

I meant for overall images.

Buttons, and things like that, possibly, but I wouldn't make it a core feature.
 
Top Bottom