Add an Expires Header

Hello everyone

In rails how can add an expires header. In which file i need write expires year code?

Please advice.

If you are running on production environment then you can add expires headers on nginx configration file

hi

sorry for my ignorance, in my server which file i need to enter expires code like

<filesmatch “.(jpg|gif|png|css|js|ico)$”>

ExpiresActive on

ExpiresDefault “access plus 1 year”

response.headers['Expires'] = CGI.rfc1123_date(10.days.from_now)