Hi all, Ive been googling for couple of hours and I just cant figure it out. I want to set the max-age value to 300 for the WHOLE application, regardless of development or production mode. Is there anyone that knows? Petr -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Michael Graff
2009-Mar-23 16:30 UTC
Re: Just how the hell do you set Cache-Control max-age?
I would probably set this in the web front-end (apache, etc) This is where I do expires stuff. I have to be careful though since most of the examples I''ve seen literally say to set it globally, but Rails uses the public directory for caching as well. For max age, I''d consider having Apache set it, so it will also be set for cached files, if you use any caching. --Michael On Mon, Mar 23, 2009 at 7:49 AM, Petr Janda <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Hi all, > > Ive been googling for couple of hours and I just cant figure it out. I > want to set the max-age value to 300 for the WHOLE application, > regardless of development or production mode. > > Is there anyone that knows? > > Petr > -- > Posted via http://www.ruby-forum.com/. > > > >-- (Ruby, Rails, Random) blog: http://skandragon.blogspot.com/ --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Chris Kottom
2009-Mar-25 14:34 UTC
Re: Just how the hell do you set Cache-Control max-age?
Hi Petr, Rails provides ActionController#expires_in and ActionController#expires_now for doing this on a case-by-case basis, but Michael is right that this is something you want to be doing on your HTTP server, not in your application. On Mon, Mar 23, 2009 at 5:30 PM, Michael Graff <skan.gryphon-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote:> > I would probably set this in the web front-end (apache, etc) This is > where I do expires stuff. I have to be careful though since most of > the examples I''ve seen literally say to set it globally, but Rails > uses the public directory for caching as well. > > For max age, I''d consider having Apache set it, so it will also be set > for cached files, if you use any caching. > > --Michael > > > On Mon, Mar 23, 2009 at 7:49 AM, Petr Janda > <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: > > > > Hi all, > > > > Ive been googling for couple of hours and I just cant figure it out. I > > want to set the max-age value to 300 for the WHOLE application, > > regardless of development or production mode. > > > > Is there anyone that knows? > > > > Petr > > -- > > Posted via http://www.ruby-forum.com/. > > > > > > > > > > > -- > (Ruby, Rails, Random) blog: http://skandragon.blogspot.com/ > > > >--~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---