I have a rails app. that does both page and action caching. In my
development environment this works flawlessly. However, when I deploy
to my server, the action cache files do not appear in the
tmp/cache/SERVER_NAME/CONTROLLER/ACTION directories. I also checked the
system level /tmp directory and do not see the files there. What’s
weird is that the logs indicate that action caching is working (filter
chains are halting and the code is not executed). My worry is that it
somehow defaulted back to some sort of memory caching mechanism (which
would be bad as there is a potential for a lot of action cache files).
Does anyone know of alternative fall-backs or settings that would cause
Rails to place the action cache files somewhere other than in the
tmp/cache/SERVER_NAME/CONTROLLER/ACTION directory?
Anyone have any insight on this?
Hi Caleb,
which webserver are you using? It could have something to do with the
fact that the webserver doesn’t have the rights to write into
tmp/cache/SERVER_NAME/CONTROLLER/ACTION. Check the rights of the
tmp/cache folder and check the logs of your webserver. Let me know if it
works out.
Kind regards,
Nick S.
Compare and review Rails hosting plans
As far as I know, action caches go to memory and are cleared by a server
restart. Anyone else know different?
Cody S.-2 wrote:
–
View this message in context:
http://www.nabble.com/-Rails--Action-Caching---Where'd-the-files-go--tf2954607.html#a8303044
Sent from the RubyOnRails Users mailing list archive at Nabble.com.
Different versions of Rails have different default locations for the
Action Cache. If your production server is using an older Rails Gem,
then the action cache could be stored in memory.
Newer Rails versions use the RAILS_ROOT/tmp/cache directory by default.
I don’t know when this changed.
You can configure to use the File system instead of using the default
location in environment.rb:
ActionController::Base.fragment_cache_store = :file_store,
“/path/to/cache/directory”