Welcome Guest | Login

Where are fragments cached?

I'm using fragment caching in my app and I'm seeing some weird behaviour that is only appearing in production mode on my shared server hosting plan.

I'm using sweepers (observers) to clear the cache whenever something is saved, and when I run in production mode locally, everything is fine, the cache is being cleared as expected.

Locally my fragments are store in <app>/tmp/cache/...

I have not overwritten any of the default rules in any of my config files, but, I can't find the cache folder for my app on the server. (for either a cap deployed app or a fastcgi app).  Where are the fragments stored?

2007-09-13 07:46 AM

Hello,

You can try manually creating the folders
-------------------
 tmp/sessions
 tmp/cache
-------------------

and see if it fixes the issue. Thank you

2007-09-13 08:02 AM

HostingRails Support
Thanks.  I tried that (based on this forum post: http://www.hostingrails.com/forums/rails_coding_thread/385 ) but still nothing...

2007-09-13 08:06 AM

Hello,

I checked your cache folder and could see that there are few files in now. Could you please check it again ?

2007-09-13 08:20 AM

HostingRails Support
Okay - it's working now, after doing all 3 of the following:

1. create <app>/tmp/cache AND <app>/tmp/sessions (even those I use a db session store)
2. Add ActionController::Base.fragment_cache_store = :file_store, "#{RAILS_ROOT}/tmp/cache" to   my environment.rb
3. Restart the app
steps 2 and 3 were only needed for the version of the app running on mongrel.  For my fastcgi test version I only needed to do step 1.

It's still very confusing as to where the cache was being stored before! (it was being stored, just not swept reliably)

2007-09-13 08:24 AM

Hello,

I guess it was stored in the /tmp directory of the server. You need to have the tmp directory inside you apps folder in order to manage it.

2007-09-13 08:26 AM

HostingRails Support

Hello Guest! In order to post you must be an active client with us, please log in or sign up today!