If you are running Rails on Heroku, use this gem to properly serve assets.
github.com
github.com
Rails apps on Heroku need a number of non-default configurations to work well, and this is one of them.
Thanks for this - I'll add it to a project this weekend and probably do an updated version of my blog post on this subject: http://blog.craz8.com/articles/2012/12/7/heroku-config-for-p...
It uploads all your assets to S3 during pre-compile. It keeps ALL of the asset loading logic off your application.
Also, it uploads .gz versions of all assets.
You can use your app as a root origin for your assets, and then use something like CloudFront to offload most of the work.