# How can I debug fragment cache or expire all?

**URL:** <https://www.ruby-forum.com/t/how-can-i-debug-fragment-cache-or-expire-all/120105>\
**Category:** Rails\
**Created:** [November 13, 2007, 8:00pm UTC](https://www.ruby-forum.com/t/how-can-i-debug-fragment-cache-or-expire-all/120105 "2007-11-13T20:00:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [November 13, 2007, 8:00pm UTC](https://www.ruby-forum.com/t/how-can-i-debug-fragment-cache-or-expire-all/120105/1 "2007-11-13T20:00:55Z")

</div>

I have been using fragment caching and it seemed like it was working  
pretty well.  
I added some things and now it is not working.

Could I have screwed it up if I deleted the cache files by hand that  
it had in the temp directory ? Even if I did that, when I re execute  
the statement: expire\_fragment(%r{ticket/get\_page.\*}) . I would think  
I would be back in business.

I all the the cache this:  
cache(:action =\> ‘get\_page’, :page =\> @page, :order =\> @order, :fields  
=\> @fields.join(’,’), :conditions =\> @tk\_conditions) do

and nothing happens, it no longer creates a file.

My read is like this, but it no longer gets anything as the cache()  
method doesn’t create anything.  
@fragment = read\_fragment({:action =\> ‘get\_page’, :page =\> @page,  
:order =\> @order, :fields =\>  
@fields.join(’,’),  
:conditions =\> @tk\_conditions})

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [November 14, 2007, 10:58pm UTC](https://www.ruby-forum.com/t/how-can-i-debug-fragment-cache-or-expire-all/120105/2 "2007-11-14T22:58:28Z")

</div>

First do these two tasks and see if it works

1. check whether your cache directory has read and write permission, &
2. run ‘rake tmp:clear’ from your app root and restart your server

I hope this should solve your problem.
