Any HTML page in my project contains two types of images:
- Images that are system defined, such as the logo and icons and buttons
- User defined images such user's profile image, or company logo etc.
On a list page typically a combination of both type of images is rendered. Now what I want is, using Rails, that all the images are compiled onto one or two big sprites at runtime depending on list of user-images or list of icons/logos being rendered in the given page. By doing this, I can avoid using img tags and deeply nested anchors which would traditionally be there in outgoing html.
Sending user images via background CSS is X times faster than img tags, and let's me keep html/haml clean. Also it would be great if someone can also advise me caching issues when spriting in runtime? (If this thing exists, in the first place.)