# Cleaning Action Cache not working for show action

**URL:** <https://www.ruby-forum.com/t/cleaning-action-cache-not-working-for-show-action/162671>\
**Category:** Rails\
**Created:** [March 12, 2009, 5:31pm UTC](https://www.ruby-forum.com/t/cleaning-action-cache-not-working-for-show-action/162671 "2009-03-12T17:31:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jawosis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/f04885/32.png) [@jawosis](https://www.ruby-forum.com/u/jawosis)\
**Post date:** [March 12, 2009, 5:31pm UTC](https://www.ruby-forum.com/t/cleaning-action-cache-not-working-for-show-action/162671/1 "2009-03-12T17:31:00Z")

</div>

Hi,

I realized (in development environment with caching activated) that  
cleaning the action cache for the show action is not working  
properly.  
The caching itself works fine - but once I try to clean the cache via  
the corresponding sweeper, the show action fragment does not get  
swept.

Here is the relevant sweeper method:  
def clear\_clientcontact\_cache(clientcontact)  
expire\_action(:controller =\> ‘clientcontacts’, :action =\>  
‘show’, :id =\> clientcontact.id)  
end

Here is the relevant logfile output:  
[Cached fragment hit: views/localhost:3000/clientcontacts/show/1]  
#this is the cached fragment  
Expired fragment: views/localhost:3000/clientcontacts/1 (0.0ms)

The problem seems to be that the expired fragment does not coincidence  
with the fragment the show action looks for: “views/localhost:3000/  
clientcontacts/show/1” (–\> “show” appears in the path) meanwhile the  
expired fragment has no “show” in the path.

Anyone knows why that happens and how I can resolve it?

Thanks for your help!

jochen
