# Browser caching of Rails assets -- for real

**URL:** <https://www.ruby-forum.com/t/browser-caching-of-rails-assets-for-real/195407>\
**Category:** Rails\
**Created:** [September 22, 2010, 9:05pm UTC](https://www.ruby-forum.com/t/browser-caching-of-rails-assets-for-real/195407 "2010-09-22T21:05:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jrochkind](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/779978/32.png) [@jrochkind](https://www.ruby-forum.com/u/jrochkind)\
**Post date:** [September 22, 2010, 9:05pm UTC](https://www.ruby-forum.com/t/browser-caching-of-rails-assets-for-real/195407/1 "2010-09-22T21:05:05Z")

</div>

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?]

> **[Browser caching of Rails assets — for real](https://bibwild.wordpress.com/2010/09/22/browser-caching-of-rails-assets-for-real/)**
>
> Note: This info is out of date with Rails 3.1 and the asset pipeline. The asset pipeline does a better job of taking care of this for you, although you may still need to do some work in apache to g…
