Add an Expires Header

80 views
Skip to first unread message

Saravanan P

unread,
Aug 21, 2012, 8:38:18 AM8/21/12
to rubyonra...@googlegroups.com
Hello everyone

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

Please advice.

G S RAO

unread,
Aug 21, 2012, 9:12:34 AM8/21/12
to rubyonra...@googlegroups.com
If you are running on production environment then you can add expires headers on nginx configration file

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/uLnVtOzeYCgJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
-------------Regards---------------
G SubbaRao
Cell:08970668850
E-Mail:subbar...@gmail.com

Saravanan P

unread,
Aug 21, 2012, 9:40:02 AM8/21/12
to rubyonra...@googlegroups.com
hi

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

<ifmodule mod_expires.c>
 <filesmatch "\.(jpg|gif|png|css|js|ico)$">
      ExpiresActive on
      ExpiresDefault "access plus 1 year"
  </filesmatch>
</ifmodule>
Regards by
Saravanan.P

Jordon Bedwell

unread,
Aug 21, 2012, 12:53:41 PM8/21/12
to rubyonra...@googlegroups.com
response.headers['Expires'] = CGI.rfc1123_date(10.days.from_now)
Reply all
Reply to author
Forward
0 new messages