Sam Kong
Sam Kong

Reputation: 5840

Page caching trick on Heroku?

I am moving a rails app to Heroku. Heroku doesn't seem to support page caching. So I generated cached pages on my development machine and checked them in to Heroku.

For example, /about_us generates public/about_us.html. But when I call /about_us, public/about_us.html doesn't seem to be called.

Should my trick work?

Thanks.

Sam

Upvotes: 0

Views: 183

Answers (1)

Carson Cole
Carson Cole

Reputation: 4461

In Rails 3, you'll be using the assets pipeline, so your assets--about_us.html--will be precompiled and put into a folder, WITHIN your public folder. Usually, this file will not be located at 'public/about_us.html'.

With your assets now precompiled, they'll be statically available and appended with an id, that will uniquely identify this asset until it is changed. With the unique signature, caching will occur on both Heroku's (last I checked) as well as within browsers.

Basically, the asset pipeline is doing this already for you.

Upvotes: 1

Related Questions