Bulletproof Rails Asset Caching
eng.wealthfront.com
eng.wealthfront.com
Compass has helpers that use the Rails asset link helpers to link to images. There are sprite helpers available as well.
AssetFingerPrint is a Rails plugin that tosses and MD5 into the asset link automatically.
Jammit compresses CSS/JS files, and the fingerprint of the resulting compiled files are picked up by AssetFingerPrint.
Thats how we roll at Poll Everywhere.
Seriously, though, how would you improve the solution? What would decrease the likelihood of serving the wrong asset or no asset at all? I'm sure there are other interesting solutions to this problem, but are they as complete and in some measurable way better?
Disclaimer: I work with Jared and enjoy the benefit of the solution as described.
(Unfortunately, the code samples were a hard for me to read, in both Firefox and Chrome --- all the newlines seem to have somehow gotten squeezed out...)
Sprockets 2 behind Amazon CloudFront does asset handling almost exactly like I want it done.
You can do the same with Varnish if you don't want to use Amazon's CDN. Having run a large site with prebuilt assets for several years, I really enjoy not having to do it anymore.