add R redis and improve