Forum: Ruby on Rails Making the browser cache an action

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
9618e8fca8d72bf01814276c53c2568c?d=identicon&s=25 Robert MannI (Guest)
on 2006-02-16 18:17
(Received via mailing list)
Hi!

What HTTP headers do I have to sent to make the browser cache the
output of an action?

I tried:

request.delete('Cache-control') but no luck.

It's an action that sends an image to the browser, hence I need that.


Thanks,
Rob
9618e8fca8d72bf01814276c53c2568c?d=identicon&s=25 Robert MannI (Guest)
on 2006-02-17 01:27
(Received via mailing list)
Wow. This is what I was looking for:

# Set cache to expire in one year
expires_in 1.year



Beautiful..
09e6ba06911a5781c04be8554f114aba?d=identicon&s=25 Rob Nichols (reggieb)
on 2007-04-25 18:48
Robert MannI wrote:
> Wow. This is what I was looking for:
>
> # Set cache to expire in one year
> expires_in 1.year
>
> Beautiful..

Where do you use expires_in? Can you set it within a controller?
This topic is locked and can not be replied to.