# Making the browser cache an action

**URL:** <https://www.ruby-forum.com/t/making-the-browser-cache-an-action/69307>\
**Category:** Rails\
**Created:** [February 16, 2006, 6:17pm UTC](https://www.ruby-forum.com/t/making-the-browser-cache-an-action/69307 "2006-02-16T18:17:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Robert\_MannI](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ac91a4/32.png) [@Robert\_MannI](https://www.ruby-forum.com/u/Robert_MannI)\
**Post date:** [February 16, 2006, 6:17pm UTC](https://www.ruby-forum.com/t/making-the-browser-cache-an-action/69307/1 "2006-02-16T18:17:33Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Robert\_MannI](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ac91a4/32.png) [@Robert\_MannI](https://www.ruby-forum.com/u/Robert_MannI)\
**Post date:** [February 17, 2006, 1:27am UTC](https://www.ruby-forum.com/t/making-the-browser-cache-an-action/69307/2 "2006-02-17T01:27:27Z")

</div>

Wow. This is what I was looking for:

# Set cache to expire in one year

expires\_in 1.year

Beautiful…

---

<div class="post-metadata">

**Author:** ![Robert\_MannI](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ac91a4/32.png) [@Robert\_MannI](https://www.ruby-forum.com/u/Robert_MannI)\
**Post date:** [April 25, 2007, 6:48pm UTC](https://www.ruby-forum.com/t/making-the-browser-cache-an-action/69307/3 "2007-04-25T18:48:51Z")

</div>

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?
