How to bust your Rails etag cache on deployment.
UPDATE: I created a gem to fix the problem I start to discuss below.
You should read the updated post about this topic, here. I describe the problem of Rails caching of etags and the gem in more detail.
Original Post
If you’re writing a Rails app that’s getting any traffic whatsoever, you probably are using some method of caching.
Client side caching with etags has been a wonderful addition to Ruby on Rails. That, combined with lazy loading of your queries, and you can save a ton of processing without needing to worry about page or action caching.
Here’s such a simple tip that wasn’t at all intuitive to me at first.
How do you bust your client side caches when you deploy your application?
If you look in the official Rails docs you can find out a tiny bit more about the methods: fresh_when and stale?, but they don’t teach anything on this issue of deployment.
In other...