# Clearing/expiring the 'index' action

**URL:** <https://www.ruby-forum.com/t/clearing-expiring-the-index-action/52963>\
**Category:** Rails\
**Created:** [January 21, 2006, 5:02pm UTC](https://www.ruby-forum.com/t/clearing-expiring-the-index-action/52963 "2006-01-21T17:02:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aravet](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/49beb7/32.png) [@aravet](https://www.ruby-forum.com/u/aravet)\
**Post date:** [January 21, 2006, 5:02pm UTC](https://www.ruby-forum.com/t/clearing-expiring-the-index-action/52963/1 "2006-01-21T17:02:35Z")

</div>

Hi all,

I’m having problems trying to expire the ‘index’ action of a controller.

In short,  
expire\_action :action =\> ‘index’  
doesn’t work, but  
expire\_fragment (url\_for :action =\>  
‘index’).gsub(//index/,’’).split("://").last  
works fine and deletes the cached page as expected.

I thought about this hack when I noticed that the cache for ‘index’ is  
not stored in a directory named as the action, but directly at the root  
level:  
cache/localhost:3001/foo.cache

I expected it to be stored 1 level deeper, in  
cache/localhost:3001/foo/index.cache

Is there a cleaner way to make this work?  
Is this a bug?

Alain

---

<div class="post-metadata">

**Author:** ![aravet](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/49beb7/32.png) [@aravet](https://www.ruby-forum.com/u/aravet)\
**Post date:** [January 21, 2006, 5:05pm UTC](https://www.ruby-forum.com/t/clearing-expiring-the-index-action/52963/2 "2006-01-21T17:05:46Z")

</div>

Hi all,

I’m having problems trying to expire the ‘index’ action of a controller.

In short,  
expire\_action :action =\> ‘index’  
doesn’t work, but  
expire\_fragment (url\_for :action =\>  
‘index’).gsub(//index/,’’).split("://").last  
works fine and deletes the cached page as expected.

I thought about this hack when I noticed that the cache for ‘index’ is  
not stored in a directory named as the action, but directly at the root  
level:  
cache/localhost:3001/foo.cache

I expected it to be stored 1 level deeper, in  
cache/localhost:3001/foo/index.cache

Is there a cleaner way to make this work?  
Is thi
