I am constantly developing my rails app and deploying about once every 1 or 2 weeks. I have a lot of content that I would like to be cached for quite awhile. I switched to using rails file_store for caching since the other caching options store the cache in memory which goes away when I have to restart passenger. The problem I am having is that every time I deploy an update, I loose my cache anyway even though it is file based. Is there a way to prevent the cache from clearing when you deploy an update for a rails app? I am using capistrano for deployment and git for version control.
Share
Make a directory under the shared directory to hold the cache. In your deploy.rb, make a symlink to the new directory where the old cache directory used to be. For example, here is a simplified version of how I symlink the log directory:
Now, whenever I deploy, my logs are continuous across deploys and stored in:
*/path/to/deploy_dir/shared/log*