Browser caching of Rails assets -- for real

While Rails adds a ?timestamp query string to the end of asset URLs,
under passenger+apache deployment (and I suspect most other deployment),
these actually have no effect whatsoever on browser caching. In some
cases this might not matter to you much — if you are able to use the
Rails helper :cache=>’filename’ argument, or if you don’t have very many
asset files, or if you aren’t trying to wring every last bit of
performance out of your app. But sometimes you really do want your
Rails assets to be cached for real by the browser, without even an
if-modified check. Below is a way to kind of hackily set up your apache
conf to do so. [btw, wouldn’t it be nice if Passenger would do this
automatically for Rails, avoiding the need for a hack?]