# Where are the cached files stored on the production server?

**URL:** <https://www.ruby-forum.com/t/where-are-the-cached-files-stored-on-the-production-server/139333>\
**Category:** Rails\
**Created:** [June 3, 2008, 12:08am UTC](https://www.ruby-forum.com/t/where-are-the-cached-files-stored-on-the-production-server/139333 "2008-06-03T00:08:06Z")\
**Posts on this page:** 4\
**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:** [June 3, 2008, 12:08am UTC](https://www.ruby-forum.com/t/where-are-the-cached-files-stored-on-the-production-server/139333/1 "2008-06-03T00:08:06Z")

</div>

I need to delete a file, but the cached files are no longer in the tmp  
folder on the production server. I don’t see them in the shared either.  
I can’t even find anything with the \*nix find command.

Any clues?

Thanks for the help.

---

<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:** [June 3, 2008, 12:17am UTC](https://www.ruby-forum.com/t/where-are-the-cached-files-stored-on-the-production-server/139333/2 "2008-06-03T00:17:59Z")

</div>

I believe cached files are stored in the public directory.

– Josh

Chris O. wrote:

> I need to delete a file, but the cached files are no longer in the tmp  
> folder on the production server. I don’t see them in the shared either.  
> I can’t even find anything with the \*nix find command.
> 
> Any clues?
> 
> Thanks for the help.

---

<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:** [June 3, 2008, 12:24am UTC](https://www.ruby-forum.com/t/where-are-the-cached-files-stored-on-the-production-server/139333/3 "2008-06-03T00:24:27Z")

</div>

Ooops, I should’ve been more specific. Most of my caching is done via  
caches\_action, not caches\_page which is stored in the public dir.

---

<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:** [June 3, 2008, 12:49am UTC](https://www.ruby-forum.com/t/where-are-the-cached-files-stored-on-the-production-server/139333/4 "2008-06-03T00:49:58Z")

</div>

Chris,

So after some digging around in the source I turned up the method  
“lookup\_store” for ActiveSupport::Cache.

Typing this into console got me the following:

> > ActiveSupport::Cache.lookup\_store  
> > =\> #\<ActiveSupport::Cache::MemoryStore:0x24f9c44 @data={}\>

Also, the documentation in the class points out the following:

# == Caching stores

# 

# All the caching stores from ActiveSupport::Caching is available to be

used as backends for Action Controller caching.

# 

# Configuration examples (MemoryStore is the default):

# 

# ActionController::Base.cache\_store = :memory\_store

# ActionController::Base.cache\_store = :file\_store,

“/path/to/cache/directory”

# ActionController::Base.cache\_store = :drb\_store,

“druby://localhost:9192”

# ActionController::Base.cache\_store = :mem\_cache\_store, “localhost”

# ActionController::Base.cache\_store = MyOwnStore.new(“parameter”)

So, to answer your question, your caches are being stored in memory, but  
you can totally change where you want them to be stored.

Hope that helps,  
– Josh

Chris O. wrote:

> Ooops, I should’ve been more specific. Most of my caching is done via  
> caches\_action, not caches\_page which is stored in the public dir.
