From: David Heinemeier Hansson Date: 2005-07-17T23:36:04+09:00 Subject: Re: setting Expires HTTP response header > I found my own answer. > > require 'date' > > # Get current time in GMT. > t = Time.now.gmtime > > # Add one hour. > t += 60*60 > > # Set "Expires" header to this time, properly formatted. > res['Expires'] = t.strftime("%a, %d %b %Y %H:%M:%S GMT") As a pointer for others looking to do the same in Rails, we've wrapped it in a method you can call inside any action: expires_in 20.minutes ..there's also "expires_now". The method is available in beta gems and will be a part of the next release. -- David Heinemeier Hansson http://www.loudthinking.com -- Broadcasting Brain http://www.basecamphq.com -- Online project management http://www.backpackit.com -- Personal information manager http://www.rubyonrails.com -- Web-application framework