Static resource caching by configuring HTTP header in Ruby on Rails 5
Please have a look of this code and paste it in your production.rb file
config.public_file_server.headers = { 'Cache-Control' => 'public, s-maxage=31536000, maxage=15552000', 'Expires' => "#{1.year.from_now.to_formatted_s(:rfc822)}"}
Hope this will help