Capistrano is not actually associated with Rails; it is commonly used by the Rails community for deployment. No, you cannot "customize Rails" to do what you want. What you can do is add a task to your Capfile that runs shell commands to copy the cache to the new deployment before it is marked as "current."
namespace :deploy do desc "Copy cache to the new release" task :cache_copy, :roles => :app, :on_error => :continue do on_rollback { run "rm -rf #{latest_release}/public/cache" } run "cp -a #{current_path}/public/cache #{latest_release}/public" end end before "deploy:symlink", "deploy:cache_copy"
But I really do not think that you want to do such a thing for cached pages, because the cache most likely does not synchronize with the release of new code.
Chris source share