Data URI of the image instead of sprites in Ruby on Rails
To whom?
Those who are on Ruby on Rails.
Who does not use the sprites of images, but is going to move on them - and at the same time considers it as " zamom and gimor ".
Who is not going to support IE6-7 (and 8) or knows all their charms (yes it is easy to fix - but really let's bury them already).
Not lit
The correctness of writing "data URI" vs "data URL"
Performance tests - yes, only theory here
Optimization of a web application (page, resource, portal - further, for brevity, simply - an application) directly depends on the number of requests to the server. There is a wonderful presentation on this topic. As an optimization (reducing the number of requests to the server), sprites with images are applied, i.e. a group of images combined into one - and after the forces of css only its individual parts are shown. This in turn adds a lot of effort to the developer - in the event that the developer has never used sprites, but is only going to transfer his brainchild to them. In any case, the images that fit into the sprites are unlikely to ever be changed - unless, of course, the design of the application is altered altogether, i.e. Do not change the main CSS file of the application. But - why do we need a separate file with images, if you can use the data URI?
So strategy
( ) this will allow you to move all the images in the css-file <input type=image ... /> with a transparent base and a background image instead of an image a single-pixel transparent gif is used as a transparent base gluing all css into one fewer files - fewer requests (in RoR it is) css file to end md5 hash convenient for development - changing the file, changing its name (in RoR it is) css file in request header: store year if the file does not change, then we store it in the client’s cache