Cal henderson of Flickr has posted an excellent article on serving javascript, css and images in the best way for a dynamic website.
He mentions a number of great tips, with some sample code in PHP and Perl. If you're running a dynamic website, it might do you good to take a look at the article and try and steal any tips you can.
Tim Lucas has a follow-on article, suggesting a Rails plugin.
Some plugins or tools for doing some of this in Rails would be tremendous. Obviously a lot of this stuff is for very high traffic sites and involves quite a bit of hacking around with Apache and URL rewriting.
One item from Cal's article that seems pertinent to Rails specifically is his assertion that according to spec browsers shouldn't cache URLs with query parameters attached, but that Firefox and IE do (while Opera and Safari don't). I'm guessing that caching was the reason behind why recent Rails versions started generating timestamp query params at the end of URLs to static content? Does this mean it only works for IE and Firefox?
Read: Hardcore Caching secrets from Flickr