# Fragment caches not being expired

**URL:** <https://www.ruby-forum.com/t/fragment-caches-not-being-expired/138328>\
**Category:** Rails\
**Created:** [May 22, 2008, 3:08am UTC](https://www.ruby-forum.com/t/fragment-caches-not-being-expired/138328 "2008-05-22T03:08:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![chrisolsen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c6cbf5/32.png) [@chrisolsen](https://www.ruby-forum.com/u/chrisolsen)\
**Post date:** [May 22, 2008, 3:08am UTC](https://www.ruby-forum.com/t/fragment-caches-not-being-expired/138328/1 "2008-05-22T03:08:22Z")

</div>

I am having some serious issues with caching ☹

The latest problem that I have is the fragments are not being deleted.

Here is the haml code within the application.html.haml file that caches  
the text just fine

- cache(:controller =\> “layout”, :action =\> “header”, :id =\>  
@account.id) do  
#header\_links  
…

Here is the code that was originally placed within a sweeper file, then  
moved directly into the controller when trying ti figure out where the  
issue was

expire\_fragment(:controller =\> “layout”, :action =\> “header”, :id =\>  
@account\_id)

Unfortunately, it doesn’t delete the cached data. I don’t know if the  
issue is due to the fact that I am using subdomains or not. The cached  
data exists in  
tmp/cache/some\_subdomain.localhost.3000/layout/header/2.cache

Any help is appreciated.

Thanks

---

<div class="post-metadata">

**Author:** ![chrisolsen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c6cbf5/32.png) [@chrisolsen](https://www.ruby-forum.com/u/chrisolsen)\
**Post date:** [May 22, 2008, 6:38am UTC](https://www.ruby-forum.com/t/fragment-caches-not-being-expired/138328/2 "2008-05-22T06:38:07Z")

</div>

The issue was that the page was also being cached thereby eliminating  
the need for the fragment. I think I am feeling the effects of caffeine  
withdrawal.
