Rails 3.1 Assets, cache control, maximum age and expiration

I currently have an application on the Heroku cedar stack working with Unicorn.

I also have CloudFront configured as a custom source to host my css / js resources. However, be that as it may, I am setting up static / assets for Rails, this will not let me set the Cache-Control, Max-Age or Expires headers.

This is important because the headers go through CloudFront, and if I cannot install them, CloudFront will not cache them properly.

+5
source share
1 answer

Try adding this to your /production.rb environment file.

config.static_cache_control = "public, max-age=3600"
+4

All Articles