To speed up page loading, you can set the expires header far into the future for static components. However, there is one problem: you will have to change the file name or the path to it so that the user knows that the file needs to be re-read.
In Rails, there is a useful opportunity for assets timestamps , to be honest, I did not understand why this was necessary before.
if we insert all static into templates through rails helpers, then Rails in production will add to them so-called assets timestamps. Roughly speaking it: File.mtime(path).to_i.to_s # rails_asset_id
when the file is changed, the path to it will change, respectively, and the client browser will send the request again
it is necessary to make the web server install all static files that have assets timestamps Expires header c far in the future time: