HTTP caching with rails and heroku

Hi there,

I was wondering if anyone had any tips or pointers on how to do HTTP caching of pages that are mostly static, but still go through the rails stack to be rendered (because of I18n and the use of partials) using Heroku.

As far as I can tell, on Heroku we only have control once the request hits the app server, so anything we do would have to happen there, right? Is there an easy way to generate the pages on cache miss, and then use a CDN (or similar) like Fastly and set the expiration date to a year or something long like that?

Heroku has a memcached type add on - MemCachier | Heroku Dev Center

Alternatively, you could have a separate cache proxy running varnish or whatever. This would probably actually be easier to set up on a ‘normal’ vps or cloud server.

@zamith We use the approach described in these articles for the thoughtbot blog