# How do i cache this?

**URL:** <https://www.ruby-forum.com/t/how-do-i-cache-this/106621>\
**Category:** Rails\
**Created:** [June 12, 2007, 3:19pm UTC](https://www.ruby-forum.com/t/how-do-i-cache-this/106621 "2007-06-12T15:19:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mixplate](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a6a055/32.png) [@mixplate](https://www.ruby-forum.com/u/mixplate)\
**Post date:** [June 12, 2007, 3:19pm UTC](https://www.ruby-forum.com/t/how-do-i-cache-this/106621/1 "2007-06-12T15:19:20Z")

</div>

i have a account controller, where the user can make a post private or  
public.

the function that views a public post is in the ‘main’ controller.

i put cache :view\_post in the main controller, but now if the user  
changes the setting in the account controller how can i delete the cache  
that is located in the main controller?

each cache file is stored in /public/user/name\_of\_user/ cache file.

so where do i put the expire and with what parameters?

expire (:action =\> view\_post, :user =\> name\_of\_user, :id =\> id of  
article)???

thanks!
