Enabling browser-side caching for rails 3.1 app on heroku

I have a rather large jpg image file and several css files and they will not change for every reboot, but every time it loads the full imgae instead of caching in the browser, I tried to change the configuration as config.action_controller.perform_caching = true and t .d., but nothing helps. Is there any way to do this?

+8
ruby-on-rails browser-cache ruby-on-rails-3 heroku cache-control
source share
1 answer

This worked for me in my production.rb:

config.serve_static_assets = true config.static_cache_control = "public, max-age=2419200" 

These are 4 weeks that I think are good.

+7
source share

All Articles